1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.Container</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="previous" href="class-gtkcomboboxentry.html" title="gtk.ComboBoxEntry"><link rel="next" href="class-gtkcurve.html" title="gtk.Curve"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.Container</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkcomboboxentry.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkcurve.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkcontainer"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.Container</h2><p>gtk.Container — a base class for widgets that contain other
widgets</p></div><div class="refsect1" lang="en"><a name="id3395793"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Container</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a></span></span>):
<code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--set-border-width" title="gtk.Container.set_border_width">set_border_width</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>border_width</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--get-border-width" title="gtk.Container.get_border_width">get_border_width</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--add" title="gtk.Container.add">add</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--remove" title="gtk.Container.remove">remove</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--set-resize-mode" title="gtk.Container.set_resize_mode">set_resize_mode</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>resize_mode</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--get-resize-mode" title="gtk.Container.get_resize_mode">get_resize_mode</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--check-resize" title="gtk.Container.check_resize">check_resize</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--forall" title="gtk.Container.forall">forall</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>callback</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>callback_data</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--foreach" title="gtk.Container.foreach">foreach</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>callback</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>callback_data</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--get-children" title="gtk.Container.get_children">get_children</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--propagate-expose" title="gtk.Container.propagate_expose">propagate_expose</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>child</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>event</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--set-focus-chain" title="gtk.Container.set_focus_chain">set_focus_chain</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>focusable_widgets</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--get-focus-chain" title="gtk.Container.get_focus_chain">get_focus_chain</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--unset-focus-chain" title="gtk.Container.unset_focus_chain">unset_focus_chain</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--set-reallocate-redraws" title="gtk.Container.set_reallocate_redraws">set_reallocate_redraws</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>needs_redraws</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--set-focus-child" title="gtk.Container.set_focus_child">set_focus_child</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>child</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--set-focus-vadjustment" title="gtk.Container.set_focus_vadjustment">set_focus_vadjustment</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>adjustment</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--get-focus-vadjustment" title="gtk.Container.get_focus_vadjustment">get_focus_vadjustment</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--set-focus-hadjustment" title="gtk.Container.set_focus_hadjustment">set_focus_hadjustment</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>adjustment</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--get-focus-hadjustment" title="gtk.Container.get_focus_hadjustment">get_focus_hadjustment</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--resize-children" title="gtk.Container.resize_children">resize_children</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--child-type" title="gtk.Container.child_type">child_type</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--add-with-properties" title="gtk.Container.add_with_properties">add_with_properties</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>first_prop_name</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>first_prop_value</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--child-set" title="gtk.Container.child_set">child_set</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>child</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>first_prop_name</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>first_prop_value</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--child-get" title="gtk.Container.child_get">child_get</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>child</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>first_prop_name</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--child-set-property" title="gtk.Container.child_set_property">child_set_property</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>child</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>property_name</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>value</tt></i></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#method-gtkcontainer--child-get-property" title="gtk.Container.child_get_property">child_get_property</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>child</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>property_name</tt></i></span></span>)</code><br></pre></td></tr></table><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
<span class="bold"><b>Functions</b></span>
<code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#function-gtk--container-class-install-child-property" title="gtk.container_class_install_child_property">gtk.container_class_install_child_property</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>klass</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>property_id</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>pspec</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkcontainer.html#function-gtk--container-class-list-child-properties" title="gtk.container_class_list_child_properties">gtk.container_class_list_child_properties</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>klass</tt></b></span></span>)</code></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3396365"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
+-- <a href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3396396"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"border-width"</td><td valign="top">Read/Write</td><td valign="top">The width of the empty border outside the containers
children.</td></tr><tr valign="top"><td valign="top">"resize-mode"</td><td valign="top">Read/Write</td><td valign="top">Specify how resize events are handled. One of:
<tt class="literal">gtk.RESIZE_PARENT</tt>, <tt class="literal">gtk.RESIZE_QUEUE</tt> or
<tt class="literal">gtk.RESIZE_IMMEDIATE</tt></td></tr><tr valign="top"><td valign="top">"child"</td><td valign="top">Read</td><td valign="top">The child widget in the container</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3396496"></a><h2>Attributes</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table cellpadding="10" width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"border_width"</td><td valign="top">Read</td><td valign="top">The width of the empty border outside the containers
children.</td></tr><tr valign="top"><td valign="top">"resize_mode"</td><td valign="top">Read</td><td valign="top">Specify how resize events are handled. One of:
<tt class="literal">gtk.RESIZE_PARENT</tt>, <tt class="literal">gtk.RESIZE_QUEUE</tt> or
<tt class="literal">gtk.RESIZE_IMMEDIATE</tt></td></tr><tr valign="top"><td valign="top">"focus_child"</td><td valign="top">Read</td><td valign="top">The child widget that has the focus</td></tr><tr valign="top"><td valign="top">"need_resize"</td><td valign="top">Read</td><td valign="top">If TRUE the container needs resizing</td></tr><tr valign="top"><td valign="top">"reallocate_redraws"</td><td valign="top">Read</td><td valign="top">if TRUE redraw the container when a child gets
reallocated</td></tr><tr valign="top"><td valign="top">"has_focus_chain"</td><td valign="top">Read</td><td valign="top">If TRUE the container had its focus chain explicitly
set</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3396646"></a><h2>Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">"<a href="class-gtkcontainer.html#signal-gtkcontainer--add" title='The "add" gtk.Container Signal'>add</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>container</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr><tr><td><span class="term">"<a href="class-gtkcontainer.html#signal-gtkcontainer--check-resize" title='The "check-resize" gtk.Container Signal'>check-resize</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>container</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr><tr><td><span class="term">"<a href="class-gtkcontainer.html#signal-gtkcontainer--remove" title='The "remove" gtk.Container Signal'>remove</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>container</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr><tr><td><span class="term">"<a href="class-gtkcontainer.html#signal-gtkcontainer--set-focus-child" title='The "set-focus-child" gtk.Container Signal'>set-focus-child</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>container</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" lang="en"><a name="id3396824"></a><h2>Description</h2><p>The <a href="class-gtkcontainer.html" title="gtk.Container"><tt class="classname">gtk.Container</tt></a>
class provides common attributes and methods for a large number of widget
subclasses that manage the layout of other widgets within the area of a
window.</p><p>A <tt class="literal">PyGTK</tt> user interface is constructed by
nesting widgets inside widgets. Container widgets are the inner nodes in the
resulting tree of widgets: they contain other widgets. So, for example, you
might have a <a href="class-gtkwindow.html" title="gtk.Window"><tt class="classname">gtk.Window</tt></a>
containing a <a href="class-gtkframe.html" title="gtk.Frame"><tt class="classname">gtk.Frame</tt></a> containing
a <a href="class-gtklabel.html" title="gtk.Label"><tt class="classname">gtk.Label</tt></a>. If
you wanted an image instead of a textual label inside the frame, you might
replace the <a href="class-gtklabel.html" title="gtk.Label"><tt class="classname">gtk.Label</tt></a> widget with
a <a href="class-gtkimage.html" title="gtk.Image"><tt class="classname">gtk.Image</tt></a>
widget.</p><p>There are two major kinds of container widgets. Both are
subclasses of the abstract <a href="class-gtkcontainer.html" title="gtk.Container"><tt class="classname">gtk.Container</tt></a>
base class.</p><p>The first type of container widget has a single child widget and
derives from <a href="class-gtkbin.html" title="gtk.Bin"><tt class="classname">gtk.Bin</tt></a>. These
containers are decorators, that add some kind of functionality to the
child. For example, a <a href="class-gtkbutton.html" title="gtk.Button"><tt class="classname">gtk.Button</tt></a> makes its
child into a clickable button; a <a href="class-gtkframe.html" title="gtk.Frame"><tt class="classname">gtk.Frame</tt></a> draws a
frame around its child and a <a href="class-gtkwindow.html" title="gtk.Window"><tt class="classname">gtk.Window</tt></a> places
its child widget inside a top-level window.</p><p>The second type of container can have more than one child; its
purpose is to manage layout. This means that these containers assign sizes
and positions to their children. For example, a <a href="class-gtkhbox.html" title="gtk.HBox"><tt class="classname">gtk.HBox</tt></a> arranges its
children in a horizontal row, and a <a href="class-gtktable.html" title="gtk.Table"><tt class="classname">gtk.Table</tt></a> arranges
the widgets it contains in a two-dimensional grid.</p><p>To fulfill its task, a layout container must negotiate the size
requirements with its parent and its children. This negotiation is carried
out in two phases, size requisition and size allocation.</p><div class="refsect2" lang="en"><a name="sec-ContainerSizeRequisition"></a><h3>Size Requisition</h3><p>The size requisition of a widget is it's desired width and
height. This is represented by a <a href="class-gtkrequisition.html" title="gtk.Requisition"><tt class="classname">gtk.Requisition</tt></a>.</p><p>How a widget determines its desired size depends on the
widget. A <a href="class-gtklabel.html" title="gtk.Label"><tt class="classname">gtk.Label</tt></a>, for
example, requests enough space to display all its text. Container widgets
generally base their size request on the requisitions of their
children.</p><p>The size requisition phase of the widget layout process operates
top-down. It starts at a top-level widget, typically a GtkWindow. The
top-level widget asks its child for its size requisition by calling
gtk_widget_size_request(). To determine its requisition, the child asks its
own children for their requisitions and so on. Finally, the top-level widget
will get a requisition back from its child.</p></div><div class="refsect2" lang="en"><a name="sec-ContainerSizeAllocation"></a><h3>Size Allocation</h3><p>When the top-level widget has determined how much space its
child would like to have, the second phase of the size negotiation, size
allocation, begins. Depending on its configuration (see the <a href="class-gtkwindow.html#method-gtkwindow--set-resizable" title="gtk.Window.set_resizable"><tt class="methodname">gtk.Window.set_resizable</tt>()</a>
method), the top-level widget may be able to expand in order to satisfy the
size request or it may have to ignore the size request and keep its fixed
size. It then tells its child widget how much space it gets by calling the
<a href="class-gtkwidget.html#method-gtkwidget--size-allocate" title="gtk.Widget.size_allocate"><tt class="methodname">size_allocate</tt>()</a>
method. The child widget divides the space among its children and tells each
child how much space it got, and so on. Under normal circumstances, a <a href="class-gtkwindow.html" title="gtk.Window"><tt class="classname">gtk.Window</tt></a> will
always give its child the amount of space the child requested.</p><p>A child's size allocation is represented by a <a href="class-gdkrectangle.html" title="gtk.gdk.Rectangle"><tt class="classname">gtk.gdk.Rectangle</tt></a>
that contains not only a width and height, but also a position (i.e. X and Y
coordinates), so that containers can tell their children not only how much
space is available, but also where they are positioned inside the space
available to the container.</p><p>Widgets are required to honor the size allocation they receive;
a size request is only a request, and widgets must be able to cope with any
size.</p></div><div class="refsect2" lang="en"><a name="sec-ContainerChildProperties"></a><h3>Child Properties</h3><p><a href="class-gtkcontainer.html" title="gtk.Container"><tt class="classname">gtk.Container</tt></a>
introduces child properties - these are object properties that are not
specific to either the container or the contained widget, but rather to
their relation. Typical examples of child properties are the "position" or
"pack-type" of a widget which is contained in a <a href="class-gtkbox.html" title="gtk.Box"><tt class="classname">gtk.Box</tt></a>.</p><p>Use the <a href="class-gtkcontainer.html#function-gtk--container-class-install-child-property" title="gtk.container_class_install_child_property"><tt class="function">gtk.container_class_install_child_property</tt>()</a>
function to install child properties for a container class and the <a href="class-gtkcontainer.html#function-gtk--container-class-list-child-properties" title="gtk.container_class_list_child_properties"><tt class="function">gtk.container_class_list_child_properties</tt>()</a>
function to get information about existing child properties.</p><p>To set the value of a child property, use the <a href="class-gtkcontainer.html#method-gtkcontainer--child-set-property" title="gtk.Container.child_set_property"><tt class="methodname">child_set_property</tt>()</a>,
or <a href="class-gtkcontainer.html#method-gtkcontainer--child-set" title="gtk.Container.child_set"><tt class="methodname">child_set</tt>()</a>
methods. To obtain the value of a child property, use the <a href="class-gtkcontainer.html#method-gtkcontainer--child-get-property" title="gtk.Container.child_get_property"><tt class="methodname">child_get_property</tt>()</a>,
or <a href="class-gtkcontainer.html#method-gtkcontainer--child-get" title="gtk.Container.child_get"><tt class="methodname">child_get</tt>()</a>
methods. To emit notification about child property changes, use the <a href="class-gtkwidget.html#method-gtkwidget--child-notify" title="gtk.Widget.child_notify"><tt class="methodname">gtk.Widget.child_notify</tt>()</a>
method.</p></div></div><div class="refsect1" lang="en"><a name="id3397158"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkcontainer--set-border-width"></a><h3>gtk.Container.set_border_width</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_border_width</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>border_width</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>border_width</tt></b>:</span></td><td>The amount of blank space to leave
<span class="emphasis"><em>outside</em></span> the container. Valid values are in the range
0-65535 pixels.</td></tr></tbody></table><p>The <tt class="methodname">set_border_width</tt>() 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 <a href="class-gtkwindow.html" title="gtk.Window"><tt class="classname">gtk.Window</tt></a>; because
toplevel windows can't leave space outside, they leave the space inside. The
border is added on all sides of the container.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--get-border-width"></a><h3>gtk.Container.get_border_width</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_border_width</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the current border width</td></tr></tbody></table><p>The <tt class="methodname">get_border_width</tt>() method retrieves
the value of the "border-width" property of the container. See <a href="class-gtkcontainer.html#method-gtkcontainer--set-border-width" title="gtk.Container.set_border_width"><tt class="methodname">set_border_width</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--add"></a><h3>gtk.Container.add</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>widget</tt></b>:</span></td><td>a widget to be placed inside the
container</td></tr></tbody></table><p>The <tt class="methodname">add</tt>() method adds
<i class="parameter"><tt>widget</tt></i> to the container. This method is typically
used for simple containers such as <a href="class-gtkwindow.html" title="gtk.Window"><tt class="classname">gtk.Window</tt></a>, <a href="class-gtkframe.html" title="gtk.Frame"><tt class="classname">gtk.Frame</tt></a>, or <a href="class-gtkbutton.html" title="gtk.Button"><tt class="classname">gtk.Button</tt></a> that hold
a single child widget. For layout containers that handle multiple children
such as <a href="class-gtkbox.html" title="gtk.Box"><tt class="classname">gtk.Box</tt></a>
or <a href="class-gtktable.html" title="gtk.Table"><tt class="classname">gtk.Table</tt></a>,
this function will pick default packing parameters that may not be correct.
Containers that handle multiple children usually have additional methods
such as <a href="class-gtkbox.html#method-gtkbox--pack-start" title="gtk.Box.pack_start"><tt class="methodname">gtk.Box.pack_start</tt>()</a>
and <a href="class-gtktable.html#method-gtktable--attach" title="gtk.Table.attach"><tt class="methodname">gtk.Table.attach</tt>()</a>
as an alternative to <tt class="methodname">add</tt>(). Adding a widget to a
container usually results in the resizing and redrawing of the container
contents.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--remove"></a><h3>gtk.Container.remove</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>widget</tt></b>:</span></td><td>a current child of
<i class="parameter"><tt>container</tt></i></td></tr></tbody></table><p>The <tt class="methodname">remove</tt>() method removes
<i class="parameter"><tt>widget</tt></i> from the container.
<i class="parameter"><tt>widget</tt></i> must be inside the container. Note that the
container will own a reference to <i class="parameter"><tt>widget</tt></i>, 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
<i class="parameter"><tt>widget</tt></i> again, you should add a reference to
it.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--set-resize-mode"></a><h3>gtk.Container.set_resize_mode</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_resize_mode</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>resize_mode</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>resize_mode</tt></b>:</span></td><td>the new resize mode.</td></tr></tbody></table><p>The <tt class="methodname">set-resize_mode</tt>() 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
(<tt class="literal">gtk.RESIZE_PARENT</tt>), queued for later execution
(<tt class="literal">gtk.RESIZE_QUEUE</tt>) or executed immediately
(<tt class="literal">gtk.RESIZE_IMMEDIATE</tt>).</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--get-resize-mode"></a><h3>gtk.Container.get_resize_mode</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_resize_mode</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the current resize mode</td></tr></tbody></table><p>The get_resize_mode() method returns the value of the
"resize-mode" property for of the container. See <a href="class-gtkcontainer.html#method-gtkcontainer--set-resize-mode" title="gtk.Container.set_resize_mode"><tt class="methodname">set_resize_mode()</tt></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--check-resize"></a><h3>gtk.Container.check_resize</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">check_resize</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><p>The <tt class="methodname">check_resize</tt>() method emits the
"check-resize" signal on the container.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--forall"></a><h3>gtk.Container.forall</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">foreach</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>callback</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>callback_data</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>callback</tt></b>:</span></td><td>a callback</td></tr><tr><td><span class="term"><b class="parameter"><tt>callback_data</tt></b>:</span></td><td>the callback user data</td></tr></tbody></table><p>The <tt class="methodname">forall</tt>() method arranges to invoke
<i class="parameter"><tt>callback</tt></i> 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 <a href="class-gtkcontainer.html#method-gtkcontainer--foreach" title="gtk.Container.foreach"><tt class="methodname">foreach</tt>()</a>
method, rather than the <tt class="methodname">forall</tt>() method.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--foreach"></a><h3>gtk.Container.foreach</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">foreach</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>callback</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>callback_data</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>callback</tt></b>:</span></td><td>a callback</td></tr><tr><td><span class="term"><b class="parameter"><tt>callback_data</tt></b>:</span></td><td>the callback user data</td></tr></tbody></table><p>The <tt class="methodname">foreach</tt>() method arranges to invoke
<i class="parameter"><tt>callback</tt></i> on each non-internal child of the
container.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--get-children"></a><h3>gtk.Container.get_children</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_children</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a list of the container's non-internal
children.</td></tr></tbody></table><p>The <tt class="methodname">get_children</tt>() method returns the
the container's non-internal children.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--propagate-expose"></a><h3>gtk.Container.propagate_expose</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">propagate_expose</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>child</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>event</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>child</tt></b>:</span></td><td>a child of the container</td></tr><tr><td><span class="term"><b class="parameter"><tt>event</tt></b>:</span></td><td>a expose event sent to the
container</td></tr></tbody></table><p>The <tt class="methodname">propagate_expose</tt>() method sends
synthetic expose events to all children that don't have their own <a href="class-gdkwindow.html" title="gtk.gdk.Window"><tt class="classname">gtk.gdk.Window</tt></a>s when
the container receives an expose event.</p><p>The <a href="class-gtkcontainer.html#method-gtkcontainer--propagate-expose" title="gtk.Container.propagate_expose"><tt class="methodname">propagate_expose</tt>()</a>
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.</p><p>In most cases, a container can simply either simply inherit the
expose implementation from <a href="class-gtkcontainer.html" title="gtk.Container"><tt class="classname">gtk.Container</tt></a>,
or, do some drawing and then chain to the expose implementation from <a href="class-gtkcontainer.html" title="gtk.Container"><tt class="classname">gtk.Container</tt></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--set-focus-chain"></a><h3>gtk.Container.set_focus_chain</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_focus_chain</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>focusable_widgets</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>focusable_widgets</tt></b>:</span></td><td>a list or tuple containing a chain of focusable
widgets.</td></tr></tbody></table><p>The <tt class="methodname">set_focus_chain</tt>() 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.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--get-focus-chain"></a><h3>gtk.Container.get_focus_chain</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_focus_chain</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>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.</td></tr></tbody></table><p>The <tt class="methodname">get_focus_chain</tt>() 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.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--unset-focus-chain"></a><h3>gtk.Container.unset_focus_chain</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">unset_focus_chain</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><p>The <tt class="methodname">unset_focus_chain</tt>() method removes
a focus chain explicitly set with <a href="class-gtkcontainer.html#method-gtkcontainer--set-focus-chain" title="gtk.Container.set_focus_chain"><tt class="methodname">set_focus_chain</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--set-reallocate-redraws"></a><h3>gtk.Container.set_reallocate_redraws</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_reallocate_redraws</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>needs_redraws</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>needs_redraws</tt></b>:</span></td><td>the new value for the container's
reallocate_redraws attribute.</td></tr></tbody></table><p>The <tt class="methodname">set_reallocate_redraws</tt>() method
sets the reallocate_redraws attribute of the container to the value of
<i class="parameter"><tt>needs_redraws</tt></i>. Containers requesting reallocation
redraws get automatically redrawn if any of their children change
allocation.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--set-focus-child"></a><h3>gtk.Container.set_focus_child</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_focus_child</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>child</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>child</tt></b>:</span></td><td>the child widget that will get the
focus.</td></tr></tbody></table><p>The <tt class="methodname">set_focus_child</tt>() method emits the
"set-focus-child" signal that arranges for the child widget referenced by
<i class="parameter"><tt>child</tt></i> to get the focus and recalculates the container
adjustments.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--set-focus-vadjustment"></a><h3>gtk.Container.set_focus_vadjustment</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_focus_vadjustment</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>adjustment</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>adjustment</tt></b>:</span></td><td>The new vertical focus
adjustment</td></tr></tbody></table><p>The <tt class="methodname">set_focus_vadjustment</tt>() method sets
the vertical focus adjustment to the value of
<i class="parameter"><tt>adjustment</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--get-focus-vadjustment"></a><h3>gtk.Container.get_focus_vadjustment</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_focus_vadjustment</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the vertical focus adjustment, or
<tt class="literal">None</tt> if none has been set.</td></tr></tbody></table><p>The get_focus_vadjustment() method retrieves the vertical focus
adjustment for the container. See the <a href="class-gtkcontainer.html#method-gtkcontainer--set-focus-vadjustment" title="gtk.Container.set_focus_vadjustment"><tt class="methodname">set_focus_vadjustment</tt>()</a>
method.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--set-focus-hadjustment"></a><h3>gtk.Container.set_focus_hadjustment</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_focus_hadjustment</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>adjustment</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>adjustment</tt></b>:</span></td><td>The new horizontal focus
adjustment</td></tr></tbody></table><p>The <tt class="methodname">set_focus_hadjustment</tt>() method sets
the horizontal focus adjustment to the value of
<i class="parameter"><tt>adjustment</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--get-focus-hadjustment"></a><h3>gtk.Container.get_focus_hadjustment</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_focus_hadjustment</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the horizontal focus adjustment, or
<tt class="literal">None</tt> if none has been set.</td></tr></tbody></table><p>The <tt class="methodname">get_focus_hadjustment</tt>() method
retrieves the horizontal focus adjustment for the container. See <a href="class-gtkcontainer.html#method-gtkcontainer--set-focus-hadjustment" title="gtk.Container.set_focus_hadjustment"><tt class="methodname">set_focus_hadjustment</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--resize-children"></a><h3>gtk.Container.resize_children</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">resize_children</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><p>The <tt class="methodname">resize_children</tt>() method causes the
container to recalculate its size and its children's sizes.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--child-type"></a><h3>gtk.Container.child_type</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">child_type</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a type.</td></tr></tbody></table><p>The <tt class="methodname">child_type</tt>() 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 <a href="class-gtkpaned.html" title="gtk.Paned"><tt class="classname">gtk.Paned</tt></a>
which already has two children or a <a href="class-gtkwindow.html" title="gtk.Window"><tt class="classname">gtk.Window</tt></a> that
already has a child.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--add-with-properties"></a><h3>gtk.Container.add_with_properties</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_with_properties</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>first_prop_name</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>first_prop_value</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>widget</tt></i>:</span></td><td>a widget to be added</td></tr><tr><td><span class="term"><i class="parameter"><tt>first_prop_name</tt></i>:</span></td><td>the first property name</td></tr><tr><td><span class="term"><i class="parameter"><tt>first_prop_value</tt></i>:</span></td><td>a value for the first
property</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional property name and value
pairs</td></tr></tbody></table><p>The <tt class="methodname">add_with_properties</tt>() method adds
the child widget specified by <i class="parameter"><tt>widget</tt></i> 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: <a href="class-gtkbox.html" title="gtk.Box"><tt class="classname">gtk.Box</tt></a>,
<a href="class-gtkfixed.html" title="gtk.Fixed"><tt class="classname">gtk.Fixed</tt></a>,
<a href="class-gtknotebook.html" title="gtk.Notebook"><tt class="classname">gtk.Notebook</tt></a>
and <a href="class-gtktable.html" title="gtk.Table"><tt class="classname">gtk.Table</tt></a>.</p><p>For example the following adds a button to a <a href="class-gtkfixed.html" title="gtk.Fixed"><tt class="classname">gtk.Fixed</tt></a> layout
widget and sets the child properties "x" and "y" specifying the child
position in the layout:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
fixed.add_with_properties(button, "x", 10, "y", 20")
</pre></td></tr></table></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--child-set"></a><h3>gtk.Container.child_set</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">child_set</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>child</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>first_prop_name</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>child</tt></i>:</span></td><td>the child widget</td></tr><tr><td><span class="term"><i class="parameter"><tt>first_prop_name</tt></i>:</span></td><td>the first property name</td></tr><tr><td><span class="term"><i class="parameter"><tt>first_prop_value</tt></i>:</span></td><td>the value of the first
property</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional property name and value
pairs</td></tr></tbody></table><p>The <tt class="methodname">child_set</tt>() method sets the
properties for <i class="parameter"><tt>child</tt></i> using the given property name
and value pairs.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--child-get"></a><h3>gtk.Container.child_get</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">child_get</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>child</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>first_prop_name</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>child</tt></i>:</span></td><td>the child widget to get the child properties
for</td></tr><tr><td><span class="term"><i class="parameter"><tt>first_prop_name</tt></i>:</span></td><td>the first property name</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional property names</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a tuple containing the property values
requested</td></tr></tbody></table><p>The <tt class="methodname">child_get</tt>() method retrieves the
requested container child properties for
<i class="parameter"><tt>child</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--child-set-property"></a><h3>gtk.Container.child_set_property</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">child_set_property</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>child</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>property_name</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>value</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>child</tt></i>:</span></td><td>the child widget</td></tr><tr><td><span class="term"><i class="parameter"><tt>property_name</tt></i>:</span></td><td>the child property name</td></tr><tr><td><span class="term"><i class="parameter"><tt>value</tt></i>:</span></td><td>a value to associate with the
property</td></tr></tbody></table><p>The <tt class="methodname">child_set_property</tt>() method sets
the property name specified by <i class="parameter"><tt>property_name</tt></i> with the
value specified in <i class="parameter"><tt>value</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcontainer--child-get-property"></a><h3>gtk.Container.child_get_property</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">child_get_property</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>child</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>property_name</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>child</tt></i>:</span></td><td>the child widget</td></tr><tr><td><span class="term"><i class="parameter"><tt>property_name</tt></i>:</span></td><td>the child property name</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the value of the child property for the
widget</td></tr></tbody></table><p>The <tt class="methodname">child_get_property</tt>() method
retrieves the value of the child property specified by
<i class="parameter"><tt>property_name</tt></i> for the widget
<i class="parameter"><tt>child</tt></i>.</p></div></div><div class="refsect1" lang="en"><a name="id3398970"></a><h2>Functions</h2><div class="refsect2" lang="en"><a name="function-gtk--container-class-install-child-property"></a><h3>gtk.container_class_install_child_property</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.container_class_install_child_property</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>klass</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>property_id</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>pspec</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>klass</tt></b>:</span></td><td>a <a href="class-gtkcontainer.html" title="gtk.Container"><tt class="classname">gtk.Container</tt></a>
class or instance.</td></tr><tr><td><span class="term"><b class="parameter"><tt>property_id</tt></b>:</span></td><td>an integer property ID</td></tr><tr><td><span class="term"><b class="parameter"><tt>pspec</tt></b>:</span></td><td>a 4-tuple containing a parameter
specification</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.4 and above.</p></div><p>The
<tt class="function">gtk.container_class_install_child_property</tt>() function
installs a child property for the container class specified by
<i class="parameter"><tt>klass</tt></i> using the integer ID specified by
<i class="parameter"><tt>property_id</tt></i>. <i class="parameter"><tt>pspec</tt></i> is a
4-tuple containing the parameter specification:</p><div class="itemizedlist"><ul type="disc"><li>a string specifying the name of the property</li><li>an object specifying the property type</li><li>a string specifying the nickname for the property or
<tt class="literal">None</tt></li><li>a string specifying the short deciription for the property
or <tt class="literal">None</tt></li></ul></div></div><div class="refsect2" lang="en"><a name="function-gtk--container-class-list-child-properties"></a><h3>gtk.container_class_list_child_properties</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.container_class_list_child_properties</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>klass</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>klass</tt></b>:</span></td><td>a <a href="class-gtkcontainer.html" title="gtk.Container"><tt class="classname">gtk.Container</tt></a>
class or instance.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a tuple containing the list of child properties</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.4 and above.</p></div><p>The
<tt class="function">gtk.container_class_list_child_properties</tt>() function
returns a tuple containing the child properties of the container class
specified by <i class="parameter"><tt>klass</tt></i>.</p></div></div><div class="refsect1" lang="en"><a name="id3399216"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkcontainer--add"></a><h3>The "add" gtk.Container Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>container</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>container</tt></i>:</span></td><td>the container that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>widget</tt></i>:</span></td><td>the child widget</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "add" signal is emitted when <i class="parameter"><tt>widget</tt></i>
is added to the <i class="parameter"><tt>container</tt></i>.</p></div><div class="refsect2" lang="en"><a name="signal-gtkcontainer--check-resize"></a><h3>The "check-resize" gtk.Container Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>container</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>container</tt></i>:</span></td><td>the container that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "check-resize" signal is emitted when the
<tt class="methodname">check_resize</tt>() method is called forcing the
recalculation of the container and its children. See the <a href="class-gtkcontainer.html#method-gtkcontainer--set-resize-mode" title="gtk.Container.set_resize_mode"><tt class="methodname">set_resize_mode</tt>()</a>
method for details.</p></div><div class="refsect2" lang="en"><a name="signal-gtkcontainer--remove"></a><h3>The "remove" gtk.Container Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>container</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>container</tt></i>:</span></td><td>the container that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>widget</tt></i>:</span></td><td>the child widget</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "remove" signal is emitted when
<i class="parameter"><tt>widget</tt></i> is removed from
<i class="parameter"><tt>container</tt></i>.</p></div><div class="refsect2" lang="en"><a name="signal-gtkcontainer--set-focus-child"></a><h3>The "set-focus-child" gtk.Container Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>container</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>container</tt></i>:</span></td><td>the container that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>widget</tt></i>:</span></td><td>the child widget</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "set-focus-child" signal is emitted when the <a href="class-gtkcontainer.html#method-gtkcontainer--set-focus-child" title="gtk.Container.set_focus_child"><tt class="methodname">set_focus_child</tt>()</a>
method is called. <i class="parameter"><tt>widget</tt></i> is set as the child in
<i class="parameter"><tt>container</tt></i> with the focus.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtkcomboboxentry.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-gtkcurve.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.ComboBoxEntry</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.Curve</td></tr></table></div></body></html>
|