January 2018
Beginner to intermediate
454 pages
10h 8m
English
If you run the application, you'll see that the images are not shown on the toolbar buttons. This is because of the way relm works. When it generates the code, it calls the show() method on every widget, instead of show_all(). So, the toolbar and the tool buttons will be shown, but not the images, as they are only attributes of the buttons, they are not created using the widget syntax. To solve this issue, we'll call show_all() on the toolbar in the init_view() method:
#[widget] impl Widget for App { fn init_view(&mut self) { self.toolbar.show_all(); } // … }
That's why we gave a name to the toolbar widget earlier: we needed to call a method on this widget here. The init_view() method is called after the