gtk.SizeGroupan object that groups widgets so they request the same
sizeSynopsisgtk.SizeGroupgobject.GObjectgtk.SizeGroupmodeset_modemodeget_modeset_ignore_hiddenignore_hiddenget_ignore_hiddenadd_widgetwidgetremove_widgetwidgetget_widgetsAncestry+-- gobject.GObject
+-- gtk.SizeGroup
Implemented Interfacesgtk.SizeGroup
implements
gtk.Buildablegtk.SizeGroup Properties
"ignore-hidden"Read-WriteIf True, hidden widgets are ignored
when determining the size of the group.
Default value: False.
Available in GTK+ 2.8 and above."mode"Read-WriteThe directions in which the size group effects the
requested sizes of its component widgets - one of the .
Default value: gtk.SIZE_GROUP_HORIZONTAL.
gtk.SizeGroup Signal Prototypesgobject.GObject Signal PrototypesDescriptiongtk.SizeGroup
provides a mechanism for grouping a number of widgets together so they all
request the same amount of space. This is typically useful when you want a
column of widgets to have the same size, but you can't use a gtk.Table widget. The
size requested for each widget in a gtk.SizeGroup is
the maximum of the sizes that would have been requested for each widget in
the size group if they were not in the size group. The mode of the size
group (see set_mode()
and the ) determines whether
this applies to the horizontal size, the vertical size, or both
sizes:Note that size groups only affect the amount of space requested,
not the size that the widgets finally receive. If you want the widgets in a
gtk.SizeGroup to
actually be the same size, you need to pack them in such a way that they get
the size they request and not more. For example, if you are packing your
widgets into a table, you would not include the gtk.FILL
flag. gtk.SizeGroup
objects are referenced by each widget in the size group, so once you have
added all widgets to a gtk.SizeGroup. If
the widgets in the size group are subsequently destroyed, then they will be
removed from the size group and drop their references on the size group;
when all widgets have been removed, the size group will be freed.Widgets can be part of multiple size groups; PyGTK will compute
the horizontal size of a widget from the horizontal requisition of all
widgets that can be reached from the widget by a chain of size groups of
type gtk.SIZE_GROUP_HORIZONTAL or
gtk.SIZE_GROUP_BOTH, and the vertical size from the
vertical requisition of all widgets that can be reached from the widget by a
chain of size groups of type gtk.SIZE_GROUP_VERTICAL or
gtk.SIZE_GROUP_BOTH.Constructorgtk.SizeGroupmodemode :the mode for the new size
group.Returns :a new gtk.SizeGroupCreates a new gtk.SizeGroup
with the mode specified by the value of mode which is
one of the .Methodsgtk.SizeGroup.set_modeset_modemodemode :the mode to set for the size
group.The set_mode() method sets the "mode"
property of the size group to the value specified by
mode. The "mode" of the size group determines whether
the widgets in the size group should all have the same horizontal
requisition (see the ).gtk.SizeGroup.get_modeget_modeReturns :the current mode of the size
group.The get_mode() method returns the value
of the "mode" property of the size group. See the set_mode()
method.gtk.SizeGroup.set_ignore_hiddenset_ignore_hiddenignore_hiddenignore_hidden :If True hidden widgets should
be ignored when calculating the sizeThis method is available in PyGTK 2.8 and above.The set_ignore_hidden() method sets the
"ignore-hidden" property to the value of
ignore_hidden. If
ignore_hidden is True invisible
widgets will be ignored when calculating size.gtk.SizeGroup.get_ignore_hiddenget_ignore_hiddenReturns :True if hidden widgets are
ignored in size calculations.This method is available in PyGTK 2.8 and above.The get_ignore_hidden() method returns
the value of the "ignore-hidden" property of the size group. If
"ignore-hidden" is True, invisible widgets are ignored in
size calculations.gtk.SizeGroup.add_widgetadd_widgetwidgetwidget :the gtk.Widget to
addThe add_widget() method adds the widget
specified by widget to the gtk.SizeGroup.
The requisition of the widget will then be determined as the maximum of its
requisition and the requisition of the other widgets in the size group.
Whether this applies horizontally, vertically, or in both directions depends
on the mode of the size group. See the set_mode()
method for more detail.gtk.SizeGroup.remove_widgetremove_widgetwidgetwidget :the gtk.Widget to
removeThe remove_widget() method removes the widget specified by
widget from the gtk.SizeGroup.gtk.SizeGroup.get_widgetsget_widgetsReturns :a list of widgets.The get_widgets() method returns the list of
widgets associated with size_group.