Laas_tut
 

Introduction



What is a "container" ?

In GTK a container is just a standard widget able to "contains" other widgets; these can be other containers or no-container widgets (such as labels). Using containers it's very easy to develop simple or complex graphical user interfaces for your applications.

Different kinds of containers

The road to the class Gtk.Container comes directly from the class Gtk.Widget.
There are two kinds of containers: the first one can contains only one widget, the second one can contains multiple widgets; the "one-widget" container has an additional derivation thorugh the class Gtk.Bin; in this way the two family are strucutred in the following:

One-Widget containers Multiple widget containers
Gtk.Widget
  Gtk.Container
    Gtk.Bin
Gtk.Widget
  Gtk.Container

The Multiple-Widget Containers are very important in order to design the GUI of your own applications.
In this tutorial we will see the following OW-Containers:

  • Gtk.Window
  • Gtk.Frame
  • Gtk.ScrolledWindow
  • Gtk.Notebook
  • Gtk.Expander
  • Gtk.Alignment

Beyond to the previous, we will see all that widgets useful to structure the layout of the application's interface:
  • Gtk.HBox / Gtk.VBox
  • Gtk.Table
  • Gtk.HPaned / Gtk.VPaned
  • Gtk.HButtonBox / Gtk.VButtonBox

Final considerations

In all my tutorials I make explicit reference to Glade as GUI Builder; in the latest release MonoDevelop has its own GUI Builder (previously called "stetic"); I think that stetic is too young to compete with Glade, so currently I'm using Glade for all my projects. Feel free to use the built-in GUI Builder inside MonoDevelop in order to try this tutorial's code.