UPDATE: As noted by jku, GtkHBox
, GtkVBox
, and GtkTable
are now deprecated, and GtkGrid should be used instead. GtkAlignment
is also deprecated, and the properties given in the answer by Phillip Wood should be used instead.
I think you meant gtk_alignment_new(0,0,0,0)
to align to the left. But without knowing about the other widgets within the window, that looks good to me. That's how you align.
The basic layout containers in GTK are:
GtkFixed which allows widgets to be absolutely positioned.
+----------------------------+
| Widget 3 |
| Widget 2 |
| Widget 1 |
| |
+----------------------------+
GtkHBox allows widgets the be positioned horizontally:
+--------+-----+
| Widget | ... |
+--------+-----+
GtkVBox allows widgets to be positioned vertically:
+--------+
| Widget |
+--------+
| ... |
+--------+
GtkTable allows for a grid or table layout.
+--------+-----+
| Widget | ... |
+--------+-----+
| ... | ... |
+--------+-----+
In addition to those containers, there's also GtkAlignment which allows you to control the alignment of a widget within its allotted space.
GTK+ layout management is a decent tutorial providing working examples of the different layout containers.