Warning: file_put_contents(): Only -1 of 59 bytes written, possibly out of free disk space in /var/www/html/index.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 25
Packing Widgets Prev   basics Next There are different types of widgets in Gtk, depending on how many children they can contain: no - normal exactly one child widget: bin two or more widgets: conta...
Forum und email

Packing basics

There are different types of widgets in Gtk, depending on how many children they can contain:

  • no children - normal widgets
  • exactly one child widget: bin
  • two or more child widgets: container

The base widget you will begin your programs with (in most cases) is the GtkWindow, a bin. That means it can have only one child. So what now - one widget is a bit sparse for an application. The solution are the containers, of which you choose one and add that to the window. To that container, you can either add some widgets or even more containers. That gives you the ability to nest containers and get exactly that layout you have in your mind.

The different containers like GtkHBox, GtkVBox, GtkTable and GtkFixed behave different in the way they layout and arrange widgets. Each one suits a certain purpose and need to be combined to achieve advanced layouts.