GTK#

Packing Widgets Theory

If you come from Windows, you're probably used to position several widgets using coordinates. Also possible, that's not the way it's done in GTK#. Most packing is done by creating boxes. These are invisible widget containers that we can pack our widgets into which come in two forms, a horizontal box, and a vertical box. While this is more difficult for a newcomer it has some advantages:

There are other kind of methods to pack widgets that is using packing widgets. There are two boxes: vbox and hbox. The creation of that is too simple, only you have to create an instance of HBox or VBox like the Button widgets.

Two important methods of that packing boxes are PackStart and PackEnd, these methods packing the element beginning with the top to the button and the second will do button to up in VBox. In HBox you package the samples left to right with PackStart and right to left with PackEnd.

By using these calls, GTK knows where you want to place your widgets so it can do automatic resizing and other nifty things. There are also a number of options as to how your widgets should be packed. As you can imagine, this method gives us a quite a bit of flexibility when placing and creating widgets.