We'll now add other widgets to our window: an image to show the cover of the song that is currently being played and a cursor to see the progression of the music. However, it is not possible to add multiple widgets to a window. To do so, we need to use containers.
Containers are a way to manage how multiple widgets will be shown.
Here are simple non-visual containers:
gtk::Box
: disposes widgets either horizontally or verticallygtk::Grid
: disposes widgets in rows and columns, like a tablegtk::Fixed
: displays widgets at a very specific position in pixelsgtk::Stack
: displays only one widget at a time
All of these widgets, except gtk::Fixed
, automatically rearrange the widgets when the window is resized. That's why you should avoid using this one.
Here are some more fancy containers:
gtk::Notebook
: displays only one widget at a time, but the user can select which one to show by clicking on a tabgtk::Paned
: displays two widgets, separated by a handle that the user can...