|
class gtk.ButtonBox(gtk.Box): |
+--gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Box +-- gtk.ButtonBox
|
|
|
A button box is used to provide a consistent layout of buttons
throughout an application. The gtk.ButtonBox
is
subclassed by the gtk.HButtonBox
and gtk.VButtonBox
classes to provide horizontal and vertical button layouts respectively. The
same effect could be achieved by using a gtk.Box
but less
conveniently.
A buttonbox provides one default layout and a default spacing value that are persistent across all widgets. The layout/spacing can then be altered by the programmer, or if desired, by the user to alter the 'feel' of a program to a small degree.
The gtk.Box.get_spacing
()
method and the gtk.Box.set_spacing
()
methods retrieve and change the default number of pixels between buttons.
The get_layout
()
and set_layout
()
methods retrieve and alter the style used to spread the buttons in a button
box across the container. The layout styles are:
gtk.BUTTONBOX_SPREAD
,
gtk.BUTTONBOX_EDGE
,
gtk.BUTTONBOX_START
and
gtk.BUTTONBOX_END
.
def get_layout()
Returns : | the layout style used by the buttonbox |
The get_layout
() method returns the
current value of the "layout-style" property. The possible values are:
gtk.BUTTONBOX_SPREAD
,
gtk.BUTTONBOX_EDGE
,
gtk.BUTTONBOX_START
and
gtk.BUTTONBOX_END
.
def set_layout(layout_style
)
| the new layout style |
The set_layout
() method sets the
"layout-style" property to the value in layout_style
.
The possible values are: gtk.BUTTONBOX_SPREAD
,
gtk.BUTTONBOX_EDGE
,
gtk.BUTTONBOX_START
and
gtk.BUTTONBOX_END
.
def get_child_secondary(child
)
| a child button of the buttonbox |
Returns : | if True , the
child appears in a secondary group of the button
box. |
This method is available in PyGTK 2.4 and above.
The get_child_secondary
() method
returns True
if child
should
appear in a secondary group of children. See the set_child_secondary
()
method for more information.
def set_child_secondary(child
, is_secondary
)
| a child button of the buttonbox |
| if True , the
child appears in a secondary group of the button
box. |
The set_child_secondary
() method sets
whether child
should appear in a secondary group of
children. The typical use of a secondary child is the help button in a
dialog that is displayed away from the main group of buttons e.g. right
aligned.
The secondary group appears after the other children if the
style is gtk.BUTTONBOX_START
,
gtk.BUTTONBOX_SPREAD
or
gtk.BUTTONBOX_EDGE
, and before the the other children if
the style is gtk.BUTTONBOX_END
. For horizontal button
boxes, the definition of before/after depends on direction of the widget
(see gtk.Widget.set_direction()
).
If the style is gtk.BUTTONBOX_START
or
gtk.BUTTONBOX_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.
© manpagez.com 2000-2024 Individual documents may contain additional copyright information.