Open john01dav opened 3 years ago
What I do in this case is bind the widget, so in the view! macro:
#[name="myview"]
gtk::TextView {}
Then I manually set the contents when the widget is created and when it's updated.
self.widgets.myview.set_text(..);
For the creation, you can add to the widget a fn init_view(&mut self) {}
, and updates in the fn update
when events are received.
Hope that helps!
I just went through the mini tutorial in the README.md, and I really like this library to provide structure to my GTK-rs applications, but I need to use a
gtk::TextView
and when I tried to make it work with theview!
macro it failed.Code:
Error:
Versions of my dependencies:
MCVE (might have some other trivial errors and isn't complete (I wanted to make a trivial notepad clone to try out the library), but it demonstrates the issue):
I assume that this means that the view! macro doesn't support blocks, but given this, I don't see how I can use a
gtk::TextView
.