Revision [32933]
This is an old revision of gtkdialogDocTips9.3 made by zigbert on 2020-07-31 03:16:56.
9.3 Understand the alignment
Gtkdialog tends to align objects to the right side of the window. Exceptions are radiobuttons and checkboxes which are aligned to the left. It is easy to center whatever object in your gui. Here's some alignment explanation:
- <hbox><button>...</button></hbox> will place button to the right.
- <button>...</button> and button will fill whole line.
- <hbox homogeneous=true><button>...</button></hbox> will place button in horizontal center.
- <hbox homogeneous=true><vbox homogeneous=true><button>...</button></vbox></hbox> will place button in center both vertical and horizontal.
- <hbox><text xalign="0">...</text></hbox> will place text at left. xalign/yalign may hold 0, 1 or 2 for left, right or center. xalign/yalign works for other widgets as well. For buttons they describe placement of label rather than button itself.
Using vertical rows can be troublesome, because often, the label defines the width of the objects. This leads to different width and it all looks crappy. You can override this by the attribute <vbox width-request="x">...</vbox>, where x represent the number of pixels for the width of the row. There is also a height-request attribute.