2000-01-05 15:04:23 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
GtkObject
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2004-10-11 20:10:52 +00:00
|
|
|
The base class of the GTK+ type hierarchy
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<refsect2>
|
|
|
|
<title>Description</title>
|
|
|
|
<para>
|
2001-10-02 19:40:54 +00:00
|
|
|
#GtkObject is the base class for all widgets, and for a few
|
|
|
|
non-widget objects such as #GtkAdjustment. #GtkObject predates
|
|
|
|
#GObject; non-widgets that derive from #GtkObject rather than
|
|
|
|
#GObject do so for backward compatibility reasons.
|
|
|
|
</para>
|
|
|
|
<para>
|
2005-11-28 14:37:53 +00:00
|
|
|
#GtkObject<!-- -->s are created with a "floating" reference count.
|
|
|
|
This means that the initial reference is not owned by anyone. Calling
|
|
|
|
g_object_unref() on a newly-created #GtkObject is incorrect, the floating
|
|
|
|
reference has to be removed first. This can be done by anyone at any time,
|
|
|
|
by calling g_object_ref_sink() to convert the floating reference into a
|
|
|
|
regular reference. g_object_ref_sink() returns a new reference if an object
|
|
|
|
is already sunk (has no floating reference).
|
2001-10-02 19:40:54 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
When you add a widget to its parent container, the parent container
|
|
|
|
will do this:
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
<informalexample><programlisting>
|
2005-11-28 14:37:53 +00:00
|
|
|
g_object_ref_sink (G_OBJECT (child_widget));
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
</programlisting></informalexample>
|
2005-11-28 14:37:53 +00:00
|
|
|
This means that the container now owns a reference to the child widget
|
|
|
|
and the child widget has no floating reference.
|
2001-10-02 19:40:54 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The purpose of the floating reference is to keep the child widget alive
|
|
|
|
until you add it to a parent container:
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
<informalexample><programlisting>
|
2002-04-18 22:04:46 +00:00
|
|
|
button = gtk_button_new (<!-- -->);
|
2001-10-02 19:40:54 +00:00
|
|
|
/* button has one floating reference to keep it alive */
|
|
|
|
gtk_container_add (GTK_CONTAINER (container), button);
|
|
|
|
/* button has one non-floating reference owned by the container */
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
</programlisting></informalexample>
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
2001-10-02 19:40:54 +00:00
|
|
|
#GtkWindow is a special case, because GTK+ itself will ref/sink it on creation.
|
|
|
|
That is, after calling gtk_window_new(), the #GtkWindow will have one
|
|
|
|
reference which is owned by GTK+, and no floating references.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
2001-10-02 19:40:54 +00:00
|
|
|
|
2000-01-05 15:04:23 +00:00
|
|
|
<para>
|
2001-10-02 19:40:54 +00:00
|
|
|
One more factor comes into play: the "destroy" signal, emitted by the
|
|
|
|
gtk_object_destroy() method. The "destroy" signal asks all code owning a
|
|
|
|
reference to an object to release said reference. So, for example, if you call
|
|
|
|
gtk_object_destroy() on a #GtkWindow, GTK+ will release the reference count that
|
|
|
|
it owns; if you call gtk_object_destroy() on a #GtkButton, then the button will
|
|
|
|
be removed from its parent container and the parent container will release its
|
|
|
|
reference to the button. Because these references are released, calling
|
|
|
|
gtk_object_destroy() should result in freeing all memory associated with an
|
|
|
|
object, unless some buggy code fails to release its references in response to
|
|
|
|
the "destroy" signal. Freeing memory (referred to as
|
|
|
|
<firstterm>finalization</firstterm> only happens if the reference count reaches
|
|
|
|
zero.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
2001-10-02 19:40:54 +00:00
|
|
|
<para>
|
|
|
|
Some simple rules for handling #GtkObject:
|
|
|
|
<itemizedlist>
|
2000-01-05 15:04:23 +00:00
|
|
|
<listitem><para>
|
2001-10-02 19:40:54 +00:00
|
|
|
Never call g_object_unref() unless you have previously called g_object_ref(),
|
|
|
|
even if you created the #GtkObject. (Note: this is <emphasis>not</emphasis>
|
|
|
|
true for #GObject; for #GObject, the creator of the object owns a reference.)
|
2000-01-05 15:04:23 +00:00
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
2001-10-02 19:40:54 +00:00
|
|
|
Call gtk_object_destroy() to get rid of most objects in most cases.
|
|
|
|
In particular, widgets are almost always destroyed in this way.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para></listitem>
|
2001-10-02 19:40:54 +00:00
|
|
|
<listitem><para> Because of the floating reference count, you don't need to
|
|
|
|
worry about reference counting for widgets and toplevel windows, unless you
|
Doc typo fix. (#68172)
* gtk/gtksocket.c (gtk_socket_get_id): Doc typo fix. (#68172)
* gtk/gtktreemodel.c (gtk_tree_path_is_descendant): Fix docs.
* gtk/gtktreemodel.c (gtk_tree_model_rows_reordered): Document.
* gtk/gtkwindow.c (gtk_window_remove_accel_group): Fix docs.
* gtk/gtkrc.c (gtk_rc_get_style_by_paths),
gtk/gtkwidget.c (gtk_widget_get_toplevel,
gtk_widget_push_composite_child), gtk/gtkdialog.c
(gtk_dialog_new_with_buttons, gtk_dialog_run): Keep gtk-doc
from messing up the indentation of inline examples.
* gtk/gtkmain.c, gtk/gtkrc.c: Consistently call g_getenv()
instead of getenv().
* gtk/gtktreemodel.c, gtk/gtkaccelgroup.c, gtk/gtkclipboard.c,
gtk/gtkdnd.c, gtk/gtkiconfactory.c, gtk/gtkrc.c,
gtk/gtkstyle.c, gtk/gtkselection.c: Doc fixes.
* gtk/gtkaccelmap.c (gtk_accel_map_add_filter,
gtk_accel_map_foreach_unfiltered, gtk_accel_map_load_scanner):
Document.
* gtk/tmpl/gtksocket.sgml: Mention gtk_socket_get_id()
instead of GTK_WINDOW_XWINDOW(). (#68172)
* gtk/gtk-sections.txt: Move functions which are documented
as "private" or "internal" into Private subsections.
* gtk/tmpl/gtkdnd.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtktooltips.sgml,
gtk/tmpl/gtkwidget.sgml, gtk/tmpl/gtkclipboard.sgml,
gtk/tmpl/gtkstyle.sgml, gtk/tmpl/gtkselection.sgml,
gtk/tmpl/gtkfeatures.sgml: Minor markup fixes.
* gtk/tmpl/gtksignal.sgml: Add link to GLib signal docs.
* gtk/tmpl/gtkpreview.sgml, gtk/tmpl/gtktext.sgml,
gtk/tmpl/gtktree.sgml: Remove "deprecated" from short desc.
* gtk/tmpl/gtkrc.sgml: Correct names of default RC files.
2002-01-08 00:04:57 +00:00
|
|
|
explicitly call g_object_ref() yourself.</para></listitem>
|
2001-10-02 19:40:54 +00:00
|
|
|
</itemizedlist>
|
|
|
|
</para>
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
</refsect2>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
2001-10-02 19:40:54 +00:00
|
|
|
#GObject
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
2005-06-20 22:06:27 +00:00
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
|
|
|
2000-01-05 15:04:23 +00:00
|
|
|
<!-- ##### STRUCT GtkObject ##### -->
|
|
|
|
<para>
|
2001-12-07 23:39:54 +00:00
|
|
|
The object itself. You should never use these members directly -
|
|
|
|
use the accessing macros instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
2004-07-20 02:26:06 +00:00
|
|
|
<!-- ##### SIGNAL GtkObject::destroy ##### -->
|
|
|
|
<para>
|
|
|
|
Signals that all holders of a reference to the #GtkObject should release
|
|
|
|
the reference that they hold. May result in finalization of the object
|
|
|
|
if all references are released.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: the object which received the signal.
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkObject:user-data ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2000-01-05 15:04:23 +00:00
|
|
|
<!-- ##### MACRO GTK_OBJECT_TYPE ##### -->
|
|
|
|
<para>
|
2001-12-07 23:39:54 +00:00
|
|
|
Gets the type of an object.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
2001-12-07 23:39:54 +00:00
|
|
|
@object: a #GtkObject.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### MACRO GTK_OBJECT_TYPE_NAME ##### -->
|
2000-01-05 15:04:23 +00:00
|
|
|
<para>
|
2001-12-07 23:39:54 +00:00
|
|
|
Gets the name of an objects type.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
2001-12-07 23:39:54 +00:00
|
|
|
@object: a #GtkObject.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### ENUM GtkObjectFlags ##### -->
|
|
|
|
<para>
|
|
|
|
Tells about the state of the object.
|
|
|
|
</para>
|
|
|
|
|
2002-01-04 23:49:20 +00:00
|
|
|
@GTK_IN_DESTRUCTION: the object is currently being destroyed. This is used
|
2002-01-06 21:09:26 +00:00
|
|
|
internally by GTK+ to prevent reinvokations during destruction.
|
2001-10-02 19:40:54 +00:00
|
|
|
@GTK_RESERVED_2: reserved for future use
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
<!-- ##### MACRO GTK_OBJECT_FLAGS ##### -->
|
|
|
|
<para>
|
2001-12-07 23:39:54 +00:00
|
|
|
Gets the #GtkObjectFlags for an object without directly
|
2000-01-05 15:04:23 +00:00
|
|
|
accessing its members.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@obj: the object whose flags are returned.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GTK_OBJECT_FLOATING ##### -->
|
|
|
|
<para>
|
2001-10-02 19:40:54 +00:00
|
|
|
Evaluates to %TRUE if the object still has its floating reference count.
|
|
|
|
See the overview documentation for #GtkObject.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@obj: the object to examine.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### ENUM GtkArgFlags ##### -->
|
|
|
|
<para>
|
|
|
|
Possible flags indicating how an argument should be treated.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@GTK_ARG_READABLE: the argument is readable. (i.e. can be queried)
|
|
|
|
@GTK_ARG_WRITABLE: the argument is writable. (i.e. settable)
|
|
|
|
@GTK_ARG_CONSTRUCT: the argument needs construction.
|
|
|
|
@GTK_ARG_CONSTRUCT_ONLY: the argument needs construction (and will
|
|
|
|
be set once during object creation), but is otherwise cannot be
|
|
|
|
set. Hence this flag is not allowed with #GTK_ARG_WRITABLE,
|
|
|
|
and is redundant with #GTK_ARG_CONSTRUCT.
|
|
|
|
@GTK_ARG_CHILD_ARG: an argument type that applies to (and may be different for)
|
|
|
|
each child. Used by #GtkContainer.
|
2005-12-20 05:47:43 +00:00
|
|
|
@Deprecated: Use corresponding #GParamSpec features instead
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_new ##### -->
|
|
|
|
<para>
|
2001-12-07 23:39:54 +00:00
|
|
|
Constructs an object given its arguments, enumerated in the call to the
|
2003-03-04 00:04:26 +00:00
|
|
|
function.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@type: the type identifying this object. Returned by gtk_type_unique()
|
2001-12-07 23:39:54 +00:00
|
|
|
(although for a properly-written object it should be accessible through
|
|
|
|
a #GTK_TYPE_FOO macro.)
|
|
|
|
@first_property_name: name of the first property to set when constructing
|
|
|
|
the object.
|
2000-01-05 15:04:23 +00:00
|
|
|
@Varargs: the first argument's value, followed by any number of
|
2001-12-07 23:39:54 +00:00
|
|
|
name/argument-value pairs, terminated with %NULL.
|
|
|
|
@Returns: the new #GtkObject.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_new() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_sink ##### -->
|
|
|
|
<para>
|
2001-10-02 19:40:54 +00:00
|
|
|
Removes the floating reference from a #GtkObject, if it exists;
|
|
|
|
otherwise does nothing. See the #GtkObject overview documentation at
|
|
|
|
the top of the page.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: the object to sink.
|
2005-12-20 05:47:43 +00:00
|
|
|
@Deprecated: 2.10: Use g_object_ref_sink() instead
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_ref ##### -->
|
|
|
|
<para>
|
2001-12-07 23:39:54 +00:00
|
|
|
Increases the reference count of the object.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: the object to reference.
|
2001-12-07 23:39:54 +00:00
|
|
|
@Returns: @object.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_ref() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_unref ##### -->
|
|
|
|
<para>
|
2001-12-07 23:39:54 +00:00
|
|
|
Decreases the reference count of an object. When its reference count drops
|
2003-03-04 00:04:26 +00:00
|
|
|
to 0, the object is finalized (i.e. its memory is freed).
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: the object to dereference.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_unref() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_weakref ##### -->
|
|
|
|
<para>
|
2003-03-04 00:04:26 +00:00
|
|
|
Adds a weak reference callback to an object. Weak references are used for notification when an object is
|
2001-10-02 19:40:54 +00:00
|
|
|
finalized. They are called "weak references" because they allow you to safely
|
|
|
|
hold a pointer to an object without calling g_object_ref() (g_object_ref() adds
|
|
|
|
a strong reference, that is, forces the object to stay alive).
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: object to weakly reference.
|
|
|
|
@notify: callback to invoke before the object is freed.
|
|
|
|
@data: extra data to pass to #notify.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_weak_ref() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_weakunref ##### -->
|
|
|
|
<para>
|
|
|
|
Removes a weak reference callback to an object.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: object stop weakly referencing.
|
|
|
|
@notify: callback to search for.
|
|
|
|
@data: data to search for.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_weak_unref() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_destroy ##### -->
|
|
|
|
<para>
|
2001-10-02 19:40:54 +00:00
|
|
|
Emits the "destroy" signal notifying all reference holders that they should
|
|
|
|
release the #GtkObject. See the overview documentation at the top of the
|
|
|
|
page for more details.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The memory for the object itself won't be deleted until
|
2001-10-02 19:40:54 +00:00
|
|
|
its reference count actually drops to 0; gtk_object_destroy() merely asks
|
|
|
|
reference holders to release their references, it does not free the object.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: the object to destroy.
|
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### FUNCTION gtk_object_get ##### -->
|
|
|
|
<para>
|
2003-03-04 00:04:26 +00:00
|
|
|
Gets properties of an object.
|
2000-09-07 18:17:06 +00:00
|
|
|
</para>
|
|
|
|
|
2001-12-07 23:39:54 +00:00
|
|
|
@object: a #GtkObject.
|
|
|
|
@first_property_name: name of first property to get the value for.
|
|
|
|
@Varargs: %NULL-terminated list of name-return location pairs.
|
2003-03-11 17:06:11 +00:00
|
|
|
@Deprecated: Use g_object_get() instead.
|
|
|
|
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_set ##### -->
|
|
|
|
<para>
|
2003-03-04 00:04:26 +00:00
|
|
|
Sets properties on an object.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<informalexample>
|
|
|
|
<programlisting>
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
void set_box_properties (GtkBox* box)
|
2000-01-05 15:04:23 +00:00
|
|
|
{
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
gtk_object_set (GTK_OBJECT (box), "homogeneous", TRUE,
|
|
|
|
"spacing", 8,
|
|
|
|
NULL);
|
2000-01-05 15:04:23 +00:00
|
|
|
}
|
|
|
|
</programlisting>
|
|
|
|
</informalexample>
|
|
|
|
</para>
|
|
|
|
|
2001-12-07 23:39:54 +00:00
|
|
|
@object: a #GtkObject.
|
2001-10-02 19:40:54 +00:00
|
|
|
@first_property_name: name of the first property to set
|
2000-01-05 15:04:23 +00:00
|
|
|
@Varargs: the value of the first argument, followed optionally
|
2001-12-07 23:39:54 +00:00
|
|
|
by more name/value pairs, followed by %NULL.
|
2003-03-11 17:06:11 +00:00
|
|
|
@Deprecated: Use g_object_set() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_set_data ##### -->
|
|
|
|
<para>
|
|
|
|
Each object carries around a table of associations from
|
|
|
|
strings to pointers. This function lets you set an association.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
If the object already had an association with that name,
|
|
|
|
the old association will be destroyed.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: object containing the associations.
|
|
|
|
@key: name of the key.
|
|
|
|
@data: data to associate with that key.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_set_data() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_set_data_full ##### -->
|
|
|
|
<para>
|
|
|
|
Like gtk_object_set_data() except it adds notification
|
|
|
|
for when the association is destroyed, either by
|
|
|
|
gtk_object_remove_data() or when the object is destroyed.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: object containing the associations.
|
|
|
|
@key: name of the key.
|
|
|
|
@data: data to associate with that key.
|
|
|
|
@destroy: function to call when the association is destroyed.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_set_data_full() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_remove_data ##### -->
|
|
|
|
<para>
|
2001-10-02 19:40:54 +00:00
|
|
|
Removes a specified datum from the object's data associations (the object_data).
|
2001-12-07 23:39:54 +00:00
|
|
|
Subsequent calls to gtk_object_get_data() will return %NULL.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
If you specified a destroy handler with gtk_object_set_data_full(),
|
|
|
|
it will be invoked.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: the object maintaining the association.
|
|
|
|
@key: name of the key for that association.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_set_data() to set the object data to %NULL instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_get_data ##### -->
|
|
|
|
<para>
|
|
|
|
Get a named field from the object's table of associations (the object_data).
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: the object maintaining the associations.
|
|
|
|
@key: name of the key for that association.
|
2001-12-07 23:39:54 +00:00
|
|
|
@Returns: the data if found, or %NULL if no such data exists.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_get_data() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_remove_no_notify ##### -->
|
|
|
|
<para>
|
|
|
|
Remove a specified datum from the object's data associations (the object_data),
|
|
|
|
without invoking the association's destroy handler.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Just like gtk_object_remove_data() except that any destroy handler
|
|
|
|
will be ignored.
|
|
|
|
Therefore this only affects data set using gtk_object_set_data_full().
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: the object maintaining the association.
|
|
|
|
@key: name of the key for that association.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_steal_data() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_set_user_data ##### -->
|
|
|
|
<para>
|
|
|
|
For convenience, every object offers a generic user data
|
2001-12-07 23:39:54 +00:00
|
|
|
pointer. This function sets it.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: the object whose user data should be set.
|
|
|
|
@data: the new value for the user data.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_set_data() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_get_user_data ##### -->
|
|
|
|
<para>
|
|
|
|
Get the object's user data pointer.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This is intended to be a pointer for your convenience in
|
|
|
|
writing applications.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: the object.
|
|
|
|
@Returns: the user data field for object.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_get_data() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_add_arg_type ##### -->
|
|
|
|
<para>
|
2001-10-02 19:40:54 +00:00
|
|
|
Deprecated in favor of the #GObject property system including #GParamSpec.
|
2000-01-05 15:04:23 +00:00
|
|
|
Add a new type of argument to an object class.
|
|
|
|
Usually this is called when registering a new type of object.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@arg_name: fully qualify object name, for example GtkObject::user_data.
|
|
|
|
@arg_type: type of the argument.
|
|
|
|
@arg_flags: bitwise-OR of the #GtkArgFlags enum. (Whether the argument is
|
|
|
|
settable or gettable, whether it is set when the object is constructed.)
|
|
|
|
@arg_id: an internal number, passed in from here to the "set_arg" and
|
|
|
|
"get_arg" handlers of the object.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_set_data_by_id ##### -->
|
|
|
|
<para>
|
|
|
|
Just like gtk_object_set_data() except that it takes
|
|
|
|
a #GQuark instead of a string, so it is slightly faster.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Use gtk_object_data_try_key() and gtk_object_data_force_id()
|
|
|
|
to get an id from a string.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: object containing the associations.
|
|
|
|
@data_id: quark of the key.
|
|
|
|
@data: data to associate with that key.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_set_qdata() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_set_data_by_id_full ##### -->
|
|
|
|
<para>
|
|
|
|
Just like gtk_object_set_data_full() except that it takes
|
|
|
|
a #GQuark instead of a string, so it is slightly faster.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Use gtk_object_data_try_key() and gtk_object_data_force_id()
|
|
|
|
to get an id from a string.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: object containing the associations.
|
|
|
|
@data_id: quark of the key.
|
|
|
|
@data: data to associate with that key.
|
|
|
|
@destroy: function to call when the association is destroyed.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_set_qdata_full() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_get_data_by_id ##### -->
|
|
|
|
<para>
|
|
|
|
Just like gtk_object_get_data() except that it takes
|
|
|
|
a #GQuark instead of a string, so it is slightly faster.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Use gtk_object_data_try_key() and gtk_object_data_force_id()
|
|
|
|
to get an id from a string.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: object containing the associations.
|
|
|
|
@data_id: quark of the key.
|
2001-12-07 23:39:54 +00:00
|
|
|
@Returns: the data if found, or %NULL if no such data exists.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_get_qdata() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_remove_data_by_id ##### -->
|
|
|
|
<para>
|
|
|
|
Just like gtk_object_remove_data() except that it takes
|
|
|
|
a #GQuark instead of a string, so it is slightly faster.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Remove a specified datum from the object's data associations.
|
2001-12-07 23:39:54 +00:00
|
|
|
Subsequent calls to gtk_object_get_data() will return %NULL.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Use gtk_object_data_try_key() and gtk_object_data_force_id()
|
|
|
|
to get an id from a string.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: object containing the associations.
|
|
|
|
@data_id: quark of the key.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_set_qdata() with data of %NULL instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_object_remove_no_notify_by_id ##### -->
|
|
|
|
<para>
|
|
|
|
Just like gtk_object_remove_no_notify() except that it takes
|
|
|
|
a #GQuark instead of a string, so it is slightly faster.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Use gtk_object_data_try_key() and gtk_object_data_force_id()
|
|
|
|
to get an id from a string.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: object containing the associations.
|
2001-12-07 23:39:54 +00:00
|
|
|
@key_id: quark of the key.
|
2003-03-04 00:04:26 +00:00
|
|
|
@Deprecated: Use g_object_steal_qdata() instead.
|
2000-01-05 15:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO gtk_object_data_try_key ##### -->
|
|
|
|
<para>
|
2001-10-02 19:40:54 +00:00
|
|
|
Useless deprecated macro. Ignore it.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
2001-10-03 04:44:13 +00:00
|
|
|
|
|
|
|
|
2000-01-05 15:04:23 +00:00
|
|
|
<!-- ##### MACRO gtk_object_data_force_id ##### -->
|
|
|
|
<para>
|
2001-10-02 19:40:54 +00:00
|
|
|
Useless deprecated macro. Ignore it.
|
2000-01-05 15:04:23 +00:00
|
|
|
</para>
|
|
|
|
|
2001-10-03 04:44:13 +00:00
|
|
|
|
|
|
|
|