January 2018
Beginner to intermediate
454 pages
10h 8m
English
We'll use a gtk::Box to arrange our widgets. First of all, remove the call to Window::add() that we added before:
window.add(toolbar.toolbar());
We remove this call because we'll instead add the toolbar to the box and the box to the window. Let's do that, but before we do, we'll add a couple of new imports:
use gtk::{ Adjustment, Image, ImageExt, Scale, ScaleExt, }; use gtk::Orientation::{Horizontal, Vertical};
Then, we create the box:
let vbox = gtk::Box::new(Vertical, 0); window.add(&vbox);
(This code goes into the App::new() method.)
Here, we fully qualified gtk::Box because Box is a type from the standard library that is automatically imported. We specified that the orientation of the box is vertical and there's no spacing ...
Read now
Unlock full access