📄 gtkobject.html
字号:
VALIGN="TOP">the default emission behavior for the signal.See <AHREF="gtk-signals.html#GTK-SIGNAL-NEW">gtk_signal_new</A>().</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>marshaller</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">takes a GtkObject, a <AHREF="gtk-types.html#GTKSIGNALFUNC">GtkSignalFunc</A>, and an arrayof arguments, and invokes the function using the appropriatecalling conventions. Usually just select a functionout of gtkmarshal.h.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>return_val</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">specify the return-value type for the signal (possiblyGTK_TYPE_NONE).</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>nparams</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">specify the number of parameters the signalreceives from the caller of <AHREF="gtk-signals.html#GTK-SIGNAL-EMIT">gtk_signal_emit</A>().</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>params</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">array of GtkTypes the signal handlers for this signalshould have in their prototype (of length nparams).</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><ICLASS="EMPHASIS">Returns</I> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the signal id. (See GtkSignals) </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN34134"></A><H3><ANAME="GTK-OBJECT-NEW"></A>gtk_object_new ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING"><AHREF="gtkobject.html">GtkObject</A>* gtk_object_new (<AHREF="gtk-types.html#GTKTYPE">GtkType</A> type, const <AHREF=../glib/glib-basic-types.html#GCHAR>gchar</A> *first_arg_name, ...);</PRE></TD></TR></TABLE><P>Construct an object given its arguments, enumerated in the call to thefunction.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN34142"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>type</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the type identifying this object. Returned by <AHREF="gtk-types.html#GTK-TYPE-UNIQUE">gtk_type_unique</A>()although (for a properly-written object it should be accessible throughGTK_TYPE_FOO.)</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>first_arg_name</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">name of the first argument to set when constructingthe object.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>...</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the first argument's value, followed by any number ofname/argument-value pairs, terminated with NULL.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><ICLASS="EMPHASIS">Returns</I> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the new GtkObject. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN34165"></A><H3><ANAME="GTK-OBJECT-NEWV"></A>gtk_object_newv ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING"><AHREF="gtkobject.html">GtkObject</A>* gtk_object_newv (<AHREF="gtk-types.html#GTKTYPE">GtkType</A> object_type, <AHREF=../glib/glib-basic-types.html#GUINT>guint</A> n_args, <AHREF="gtk-types.html#GTKARG">GtkArg</A> *args);</PRE></TD></TR></TABLE><P>Construct an object with an array of arguments.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN34174"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>object_type</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the type of the object to create.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>n_args</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the number of arguments to set.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>args</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">an array of n_args arguments (which are name and value pairs).</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><ICLASS="EMPHASIS">Returns</I> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the new GtkObject. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN34195"></A><H3><ANAME="GTK-OBJECT-CONSTRUCTED"></A>gtk_object_constructed ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_object_constructed (<AHREF="gtkobject.html">GtkObject</A> *object);</PRE></TD></TR></TABLE><P>Mark an allocated object as constructed.This is used for situationsthat require precise control of the construction process.</P><P>This is done when <AHREF="gtkobject.html#GTK-OBJECT-DEFAULT-CONSTRUCT">gtk_object_default_construct</A>() is inadequate.In <AHREF="gtkclist.html">GtkCList</A> the need arises because <AHREF="gtkclist.html">GtkCList</A> does construction work thatmust happen <ICLASS="EMPHASIS">after</I> its derivers. This workcannot be done in an initializer function, so an alternateconstructor is mandatory. It calls <AHREF="gtkobject.html#GTK-OBJECT-CONSTRUCTED">gtk_object_constructed</A>() toindicate it has done its job, so that no other constructor willbe invoked.</P><P>Normally this function is just automatically run from<AHREF="gtkobject.html#GTK-OBJECT-DEFAULT-CONSTRUCT">gtk_object_default_construct</A>().</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN34209"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>object</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">object which has been constructed. This is usuallydone automatically by <AHREF="gtkobject.html#GTK-OBJECT-NEW">gtk_object_new</A>() and <AHREF="gtkobject.html#GTK-OBJECT-NEWV">gtk_object_newv</A>(). </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN34220"></A><H3><ANAME="GTK-OBJECT-DEFAULT-CONSTRUCT"></A>gtk_object_default_construct ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_object_default_construct (<AHREF="gtkobject.html">GtkObject</A> *object);</PRE></TD></TR></TABLE><P>This function is called to construct arguments that haven't been initializedbut have the GTK_ARG_CONSTRUCT flag set.</P><P>All number arguments are set to 0. All pointers and stringsare set to NULL.</P><P>Normally invoked by <AHREF="gtkobject.html#GTK-OBJECT-NEW">gtk_object_new</A>() automatically; <AHREF="gtk-types.html#GTK-TYPE-NEW">gtk_type_new</A>() canbe used to bypass it.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN34231"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>object</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the object to initialize. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN34240"></A><H3><ANAME="GTK-OBJECT-SINK"></A>gtk_object_sink ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_object_sink (<AHREF="gtkobject.html">GtkObject</A> *object);</PRE></TD></TR></TABLE><P>Decrement the initial count given to the object.Additional invocations have no effect.</P><P>This is designed to free the user from worrying aboutdereferencing an object that they have just created.So long as the object is sunk at some point, the reference countwill be set properly.</P><P>furthermore it may be sunk multiple times.Only the first time will actually dereference.</P><P>The basic outline is: when you create an object it is floating.Setting its parent causes it to be sunk, however its parenthas obtained a reference, so its reference count is one.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN34249"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>object</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the object to sink. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN34258"></A><H3><ANAME="GTK-OBJECT-REF"></A>gtk_object_ref ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_object_ref (<AHREF="gtkobject.html">GtkObject</A> *object);</PRE></TD></TR></TABLE><P>Increase the reference count of the object.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN34264"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>object</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the object to reference. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN34273"></A><H3><ANAME="GTK-OBJECT-UNREF"></A>gtk_object_unref ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_object_unref (<AHREF="gtkobject.html">GtkObject</A> *object);</PRE></TD></TR></TABLE><P>Decrease the reference count of an object. When its referencecount drops to 0, the object is deleted.</P><P>If it was not already destroyed, it will be, with <AHREF="gtkobject.html#GTK-OBJECT-DESTROY">gtk_object_destroy</A>(),then weak links are notified, then the object-data is freedand the memory for the object itself is freed using <AHREF="gtk-types.html#GTK-TYPE-FREE">gtk_type_free</A>().</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN34282"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>object</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the object to dereference. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN34291"></A><H3><ANAME="GTK-OBJECT-WEAKREF"></A>gtk_object_weakref ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_object_weakref (<AHREF="gtkobject.html">GtkObject</A> *object, <AHREF="gtk-types.html#GTKDESTROYNOTIFY">GtkDestroyNotify</A> notify, <A
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -