📄 gtkcontainer.html
字号:
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td><td></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4254003"></a><h3><a name="GTK-CONTAINER-WARN-INVALID-CHILD-PROPERTY-ID:CAPS"></a>GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID()</h3><a class="indexterm" name="id4254018"></a><pre class="programlisting">#define GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID(object, property_id, pspec)</pre><p>This macro should be used to emit a standard warning about unexpectedproperties in <code class="function">set_child_property()</code> and <code class="function">get_child_property()</code> implementations.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td><td>the <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> on which <code class="function">set_child_property()</code> or <code class="function">get_child_property()</code> was called</td></tr><tr><td><p><span class="term"><em class="parameter"><code>property_id</code></em> :</span></p></td><td>the numeric id of the property</td></tr><tr><td><p><span class="term"><em class="parameter"><code>pspec</code></em> :</span></p></td><td>the <ahref="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> of the property</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4254144"></a><h3><a name="gtk-container-border-width"></a>gtk_container_border_width</h3><a class="indexterm" name="id4254160"></a><pre class="programlisting">#define gtk_container_border_width gtk_container_set_border_width</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_container_border_width</code> is deprecated and should not be used in newly-written code. Use <a class="link" href="GtkContainer.html#gtk-container-set-border-width"><code class="function">gtk_container_set_border_width()</code></a> instead.</p></div><p>Does the same as <a class="link" href="GtkContainer.html#gtk-container-set-border-width"><code class="function">gtk_container_set_border_width()</code></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id4254212"></a><h3><a name="gtk-container-add"></a>gtk_container_add ()</h3><a class="indexterm" name="id4254225"></a><pre class="programlisting">void gtk_container_add (<a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a> *container, <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);</pre><p>Adds <em class="parameter"><code>widget</code></em> to <em class="parameter"><code>container</code></em>. Typically used for simple containerssuch as <a class="link" href="GtkWindow.html" title="GtkWindow"><span class="type">GtkWindow</span></a>, <a class="link" href="GtkFrame.html" title="GtkFrame"><span class="type">GtkFrame</span></a>, or <a class="link" href="GtkButton.html" title="GtkButton"><span class="type">GtkButton</span></a>; for more complicatedlayout containers such as <a class="link" href="GtkBox.html" title="GtkBox"><span class="type">GtkBox</span></a> or <a class="link" href="GtkTable.html" title="GtkTable"><span class="type">GtkTable</span></a>, this function willpick default packing parameters that may not be correct. Soconsider functions such as <a class="link" href="GtkBox.html#gtk-box-pack-start"><code class="function">gtk_box_pack_start()</code></a> and<a class="link" href="GtkTable.html#gtk-table-attach"><code class="function">gtk_table_attach()</code></a> as an alternative to <a class="link" href="GtkContainer.html#gtk-container-add"><code class="function">gtk_container_add()</code></a> inthose cases. A widget may be added to only one container at a time;you can't place the same widget inside two different containers.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>container</code></em> :</span></p></td><td> a <a class="link" href="GtkContainer.html" title="GtkContainer"><span class="type">GtkContainer</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td><td> a widget to be placed inside <em class="parameter"><code>container</code></em></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4254400"></a><h3><a name="gtk-container-remove"></a>gtk_container_remove ()</h3><a class="indexterm" name="id4254413"></a><pre class="programlisting">void gtk_container_remove (<a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a> *container, <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);</pre><p>Removes <em class="parameter"><code>widget</code></em> from <em class="parameter"><code>container</code></em>. <em class="parameter"><code>widget</code></em> must be inside <em class="parameter"><code>container</code></em>.Note that <em class="parameter"><code>container</code></em> will own a reference to <em class="parameter"><code>widget</code></em>, and that thismay be the last reference held; so removing a widget from itscontainer can destroy that widget. If you want to use <em class="parameter"><code>widget</code></em>again, you need to add a reference to it while it's not insidea container, using <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref"><code class="function">g_object_ref()</code></a>. If you don't want to use <em class="parameter"><code>widget</code></em>again it's usually more efficient to simply destroy it directlyusing <a class="link" href="GtkWidget.html#gtk-widget-destroy"><code class="function">gtk_widget_destroy()</code></a> since this will remove it from thecontainer and help break any circular reference count cycles.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>container</code></em> :</span></p></td><td> a <a class="link" href="GtkContainer.html" title="GtkContainer"><span class="type">GtkContainer</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td><td> a current child of <em class="parameter"><code>container</code></em></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4254575"></a><h3><a name="gtk-container-add-with-properties"></a>gtk_container_add_with_properties ()</h3><a class="indexterm" name="id4254589"></a><pre class="programlisting">void gtk_container_add_with_properties (<a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a> *container, <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *first_prop_name, ...);</pre><p>Adds <em class="parameter"><code>widget</code></em> to <em class="parameter"><code>container</code></em>, setting child properties at the same time.See <a class="link" href="GtkContainer.html#gtk-container-add"><code class="function">gtk_container_add()</code></a> and <a class="link" href="GtkContainer.html#gtk-container-child-set"><code class="function">gtk_container_child_set()</code></a> for more details.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>container</code></em> :</span></p></td><td> a <a class="link" href="GtkContainer.html" title="GtkContainer"><span class="type">GtkContainer</span></a> </td></tr><tr><td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td><td> a widget to be placed inside <em class="parameter"><code>container</code></em> </td></tr><tr><td><p><span class="term"><em class="parameter"><code>first_prop_name</code></em> :</span></p></td><td> the name of the first child property to set </td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated list of property names and values, starting with <em class="parameter"><code>first_prop_name</code></em></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4254764"></a><h3><a name="gtk-container-get-resize-mode"></a>gtk_container_get_resize_mode ()</h3><a class="indexterm" name="id4254777"></a><pre class="programlisting"><a class="link" href="gtk-Standard-Enumerations.html#GtkResizeMode">GtkResizeMode</a> gtk_container_get_resize_mode (<a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a> *container);</pre><p>Returns the resize mode for the container. See<a class="link" href="GtkContainer.html#gtk-container-set-resize-mode"><code class="function">gtk_container_set_resize_mode()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>container</code></em> :</span></p></td><td> a <a class="link" href="GtkContainer.html" title="GtkContainer"><span class="type">GtkContainer</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the current resize mode</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4254859"></a><h3><a name="gtk-container-set-resize-mode"></a>gtk_container_set_resize_mode ()</h3><a class="indexterm" name="id4254872"></a><pre class="programlisting">void gtk_container_set_resize_mode (<a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a> *container, <a class="link" href="gtk-Standard-Enumerations.html#GtkResizeMode">GtkResizeMode</a> resize_mode);</pre><p>Sets the resize mode for the container.</p><p>The resize mode of a container determines whether a resize request will be passed to the container's parent, queued for later executionor executed immediately.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -