📄 gtkobject.html
字号:
</tr><tr><td><p><span class="term"><a name="GTK-ARG-CONSTRUCT:CAPS"></a><code class="literal">GTK_ARG_CONSTRUCT</code></span></p></td><td>the argument needs construction.</td></tr><tr><td><p><span class="term"><a name="GTK-ARG-CONSTRUCT-ONLY:CAPS"></a><code class="literal">GTK_ARG_CONSTRUCT_ONLY</code></span></p></td><td>the argument needs construction (and willbe set once during object creation), but is otherwise cannot beset. Hence this flag is not allowed with <a class="link" href="GtkObject.html#GTK-ARG-WRITABLE:CAPS"><span class="type">GTK_ARG_WRITABLE</span></a>,and is redundant with <a class="link" href="GtkObject.html#GTK-ARG-CONSTRUCT:CAPS"><span class="type">GTK_ARG_CONSTRUCT</span></a>.</td></tr><tr><td><p><span class="term"><a name="GTK-ARG-CHILD-ARG:CAPS"></a><code class="literal">GTK_ARG_CHILD_ARG</code></span></p></td><td>an argument type that applies to (and may be different for)each child. Used by <a class="link" href="GtkContainer.html" title="GtkContainer"><span class="type">GtkContainer</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4278477"></a><h3><a name="gtk-object-new"></a>gtk_object_new ()</h3><a class="indexterm" name="id4278492"></a><pre class="programlisting"><a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a>* gtk_object_new (<a class="link" href="gtk-Types.html#GtkType">GtkType</a> type, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *first_property_name, ...);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_object_new</code> is deprecated and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-new"><code class="function">g_object_new()</code></a> instead.</p></div><p>Constructs an object given its arguments, enumerated in the call to thefunction.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td><td>the type identifying this object. Returned by <a class="link" href="gtk-Types.html#gtk-type-unique"><code class="function">gtk_type_unique()</code></a>(although for a properly-written object it should be accessible througha <span class="type">GTK_TYPE_FOO</span> macro.)</td></tr><tr><td><p><span class="term"><em class="parameter"><code>first_property_name</code></em> :</span></p></td><td>name of the first property to set when constructing the object.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>the first argument's value, followed by any number ofname/argument-value pairs, terminated with <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the new <a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4278654"></a><h3><a name="gtk-object-sink"></a>gtk_object_sink ()</h3><a class="indexterm" name="id4278669"></a><pre class="programlisting">void gtk_object_sink (<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a> *object);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_object_sink</code> has been deprecated since version 2.10 and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref-sink"><code class="function">g_object_ref_sink()</code></a> instead</p></div><p>Removes the floating reference from a <a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a>, if it exists; otherwise does nothing. See the <a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> overview documentation at the top of the page.</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 object to sink.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4278757"></a><h3><a name="gtk-object-ref"></a>gtk_object_ref ()</h3><a class="indexterm" name="id4278773"></a><pre class="programlisting"><a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a>* gtk_object_ref (<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a> *object);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_object_ref</code> is deprecated and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref"><code class="function">g_object_ref()</code></a> instead.</p></div><p>Increases the reference count of the object.</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 object to reference.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><em class="parameter"><code>object</code></em>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4278858"></a><h3><a name="gtk-object-unref"></a>gtk_object_unref ()</h3><a class="indexterm" name="id4278873"></a><pre class="programlisting">void gtk_object_unref (<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a> *object);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_object_unref</code> is deprecated and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> instead.</p></div><p>Decreases the reference count of an object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed). </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 object to dereference.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4278946"></a><h3><a name="gtk-object-weakref"></a>gtk_object_weakref ()</h3><a class="indexterm" name="id4278962"></a><pre class="programlisting">void gtk_object_weakref (<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a> *object, <a class="link" href="gtk-Types.html#GtkDestroyNotify">GtkDestroyNotify</a> notify, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> data);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_object_weakref</code> is deprecated and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-weak-ref"><code class="function">g_object_weak_ref()</code></a> instead.</p></div><p>Adds a weak reference callback to an object. Weak references are used for notification when an object isfinalized. They are called "weak references" because they allow you to safelyhold a pointer to an object without calling <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref"><code class="function">g_object_ref()</code></a> (<ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref"><code class="function">g_object_ref()</code></a> addsa strong reference, that is, forces the object to stay alive).</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>object to weakly reference.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>notify</code></em> :</span></p></td><td>callback to invoke before the object is freed.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td><td>extra data to pass to <span class="type">notify</span>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4279112"></a><h3><a name="gtk-object-weakunref"></a>gtk_object_weakunref ()</h3><a class="indexterm" name="id4279129"></a><pre class="programlisting">void gtk_object_weakunref (<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a> *object, <a class="link" href="gtk-Types.html#GtkDestroyNotify">GtkDestroyNotify</a> notify, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> data);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_object_weakunref</code> is deprecated and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-weak-unref"><code class="function">g_object_weak_unref()</code></a> instead.</p></div><p>Removes a weak reference callback to an object.</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>object stop weakly referencing.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>notify</code></em> :</span></p></td><td>callback to search for.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td><td>data to search for.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4279246"></a><h3><a name="gtk-object-destroy"></a>gtk_object_destroy ()</h3><a class="indexterm" name="id4279259"></a><pre class="programlisting">void gtk_object_destroy (<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a> *object);</pre><p>Emits the "destroy" signal notifying all reference holders that they shouldrelease the <a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a>. See the overview documentation at the top of the page for more details.</p><p>The memory for the object itself won't be deleted untilits reference count actually drops to 0; <a class="link" href="GtkObject.html#gtk-object-destroy"><code class="function">gtk_object_destroy()</code></a> merely asks reference holders to release their references, it does not free the object.</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 object to destroy.</td></tr></tbody></table></div></div><hr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -