Methods
gtk.Container.set_border_width
def set_border_width(border_width)
|
border_width : | The amount of blank space to leave
outside the container. Valid values are in the range
0-65535 pixels. |
The set_border_width() method sets the
"border-width" property of the container. The border width of a container is
the amount of space to leave around the outside of the container. The only
exception to this is gtk.Window; because
toplevel windows can't leave space outside, they leave the space inside. The
border is added on all sides of the container.
gtk.Container.get_border_width
Returns : | the current border width |
The get_border_width() method retrieves
the value of the "border-width" property of the container. See set_border_width().
gtk.Container.add
widget : | a widget to be placed inside the
container |
The add() method adds
widget to the container. This method is typically
used for simple containers such as gtk.Window, gtk.Frame, or gtk.Button that hold
a single child widget. For layout containers that handle multiple children
such as gtk.Box
or gtk.Table,
this function will pick default packing parameters that may not be correct.
Containers that handle multiple children usually have additional methods
such as gtk.Box.pack_start()
and gtk.Table.attach()
as an alternative to add(). Adding a widget to a
container usually results in the resizing and redrawing of the container
contents.
gtk.Container.remove
widget : | a current child of
container |
The remove() method removes
widget from the container.
widget must be inside the container. Note that the
container will own a reference to widget, and that
this may be the last reference held; so removing a widget from its container
can cause that widget to be destroyed. If you want to use
widget again, you should add a reference to
it.
gtk.Container.set_resize_mode
def set_resize_mode(resize_mode)
|
resize_mode : | the new resize mode. |
The set-resize_mode() method sets the
"resize=mode" property of the container. The resize mode of a container
determines whether a resize request will be passed to the container's parent
(gtk.RESIZE_PARENT), queued for later execution
(gtk.RESIZE_QUEUE) or executed immediately
(gtk.RESIZE_IMMEDIATE).
gtk.Container.get_resize_mode
Returns : | the current resize mode |
The get_resize_mode() method returns the value of the
"resize-mode" property for of the container. See set_resize_mode().
gtk.Container.check_resize
The check_resize() method emits the
"check-resize" signal on the container.
gtk.Container.forall
def foreach(callback, callback_data=None)
|
callback : | a callback |
callback_data : | the callback user data |
The forall() method arranges to invoke
callback on each child of the container including
children that are considered "internal" (implementation details of the
container). "Internal" children generally weren't added by the user of the
container, but were added by the container implementation itself. Most
applications should use the foreach()
method, rather than the forall() method.
gtk.Container.foreach
def foreach(callback, callback_data=None)
|
callback : | a callback |
callback_data : | the callback user data |
The foreach() method arranges to invoke
callback on each non-internal child of the
container.
gtk.Container.get_children
Returns : | a list of the container's non-internal
children. |
The get_children() method returns the
the container's non-internal children.
gtk.Container.propagate_expose
def propagate_expose(child, event)
|
child : | a child of the container |
event : | a expose event sent to the
container |
The propagate_expose() method sends
synthetic expose events to all children that don't have their own gtk.gdk.Windows when
the container receives an expose event.
The propagate_expose()
takes care of deciding whether an expose event needs to be sent to the
child, intersecting the event's area with the child area, and sending the
event.
In most cases, a container can simply either simply inherit the
expose implementation from gtk.Container,
or, do some drawing and then chain to the expose implementation from gtk.Container.
gtk.Container.set_focus_chain
def set_focus_chain(focusable_widgets)
|
focusable_widgets : | a list or tuple containing a chain of focusable
widgets. |
The set_focus_chain() method sets a
focus chain, overriding the one computed automatically by GTK. In principle
each widget in the chain should be a descendant of the container, but this
is not enforced by this method, since it's allowed to set the focus chain
before you pack the widgets, or have a widget in the chain that isn't always
packed. The necessary checks are done when the focus chain is actually
traversed.
gtk.Container.get_focus_chain
Returns : | a list containing the widgets in the focus
chain if the focus chain of the container has been set explicitly or None if
no focus chain has been explicitly set. |
The get_focus_chain() method retrieves
the focus chain of the container, if one has been set explicitly. If no
focus chain has been explicitly set, GTK computes the focus chain based on
the positions of the children. In that case, the method returns None.
gtk.Container.unset_focus_chain
The unset_focus_chain() method removes
a focus chain explicitly set with set_focus_chain().
gtk.Container.set_reallocate_redraws
def set_reallocate_redraws(needs_redraws)
|
needs_redraws : | the new value for the container's
reallocate_redraws attribute. |
The set_reallocate_redraws() method
sets the reallocate_redraws attribute of the container to the value of
needs_redraws. Containers requesting reallocation
redraws get automatically redrawn if any of their children change
allocation.
gtk.Container.set_focus_child
def set_focus_child(child)
|
child : | the child widget that will get the
focus. |
The set_focus_child() method emits the
"set-focus-child" signal that arranges for the child widget referenced by
child to get the focus and recalculates the container
adjustments.
gtk.Container.set_focus_vadjustment
def set_focus_vadjustment(adjustment)
|
adjustment : | The new vertical focus
adjustment |
The set_focus_vadjustment() method sets
the vertical focus adjustment to the value of
adjustment.
gtk.Container.get_focus_vadjustment
def get_focus_vadjustment()
|
Returns : | the vertical focus adjustment, or
None if none has been set. |
The get_focus_vadjustment() method retrieves the vertical focus
adjustment for the container. See the set_focus_vadjustment()
method.
gtk.Container.set_focus_hadjustment
def set_focus_hadjustment(adjustment)
|
adjustment : | The new horizontal focus
adjustment |
The set_focus_hadjustment() method sets
the horizontal focus adjustment to the value of
adjustment.
gtk.Container.get_focus_hadjustment
def get_focus_hadjustment()
|
Returns : | the horizontal focus adjustment, or
None if none has been set. |
The get_focus_hadjustment() method
retrieves the horizontal focus adjustment for the container. See set_focus_hadjustment().
gtk.Container.resize_children
The resize_children() method causes the
container to recalculate its size and its children's sizes.
gtk.Container.child_type
The child_type() method returns the
type of the children that can be added to the container. Note that this may
return a void type to indicate that no more children can be added, e.g. for
a gtk.Paned
which already has two children or a gtk.Window that
already has a child.
gtk.Container.add_with_properties
def add_with_properties(widget, first_prop_name, first_prop_value, ...)
|
widget : | a widget to be added |
first_prop_name : | the first property name |
first_prop_value : | a value for the first
property |
... : | additional property name and value
pairs |
The add_with_properties() method adds
the child widget specified by widget to the container
while allowing the setting of zero or more container child property values
at the same time. Containers supporting add with settable child properties
are: gtk.Box,
gtk.Fixed,
gtk.Notebook
and gtk.Table.
For example the following adds a button to a gtk.Fixed layout
widget and sets the child properties "x" and "y" specifying the child
position in the layout:
fixed.add_with_properties(button, "x", 10, "y", 20")
|
gtk.Container.child_set
def child_set(child, first_prop_name, ...)
|
child : | the child widget |
first_prop_name : | the first property name |
first_prop_value : | the value of the first
property |
... : | additional property name and value
pairs |
The child_set() method sets the
properties for child using the given property name
and value pairs.
gtk.Container.child_get
def child_get(child, first_prop_name, ...)
|
child : | the child widget to get the child properties
for |
first_prop_name : | the first property name |
... : | additional property names |
Returns : | a tuple containing the property values
requested |
The child_get() method retrieves the
requested container child properties for
child.
gtk.Container.child_set_property
def child_set_property(child, property_name, value)
|
child : | the child widget |
property_name : | the child property name |
value : | a value to associate with the
property |
The child_set_property() method sets
the property name specified by property_name with the
value specified in value.
gtk.Container.child_get_property
def child_get_property(child, property_name)
|
child : | the child widget |
property_name : | the child property name |
Returns : | the value of the child property for the
widget |
The child_get_property() method
retrieves the value of the child property specified by
property_name for the widget
child.