ButtonBox (Python) Marta Maria Casetti mmcasetti@gmail.com 2012 A container for arranging buttons ButtonBox

A calculator - the buttons are enclosed in horizontal ButtonBoxes.

Code used to generate this example
Useful methods for a ButtonBox widget

The layout of the ButtonBox are set with set_layout(layout), where layout can be Gtk.ButtonBoxStyle.SPREAD (buttons are evenly spread across the box), Gtk.ButtonBoxStyle.EDGE (buttons are placed at the edges of the box), Gtk.ButtonBoxStyle.START (buttons are grouped towards the start of the box), Gtk.ButtonBoxStyle.END (buttons are grouped towards the end of the box), Gtk.ButtonBoxStyle.CENTER (buttons are centered in the box).

set_child_secondary(button, is_secondary) sets whether button should appear in a secondary group of children. A typical use of a secondary child is the help button in a dialog. This group appears after the other children if the style is START, SPREAD or EDGE, and before the other children if the style is END. If the style is START or END, then the secondary children are aligned at the other end of the button box from the main children. For the other styles, they appear immediately next to the main children.

set_child_non_homogeneous(button, is_non_homogeneous) sets whether the child is exempted from homogeneous sizing. Default value is False.

set_spacing(spacing) sets the spacing, in pixels, between the buttons of the box.

API References

In this sample we used the following:

GtkButtonBox

GtkBox

GtkButton

GtkEntry

GtkGrid