Add a migration guide section on GtkObject

This commit is contained in:
Matthias Clasen 2010-09-26 22:29:33 -04:00
parent b81de973af
commit 87e29c99d7

View File

@ -585,6 +585,35 @@ gtk_arrow_draw (GtkWidget *widget,
value, you will have explicitly set it explicitly.
</para>
</section>
<section>
<title>GtkObject is gone</title>
<para>
GtkObject has been removed in GTK+ 3. Its remaining functionality,
the ::destroy signal, has been moved to GtkWidget. If you have non-widget
classes that are directly derived from GtkObject, you have to make
them derive from #GInitiallyUnowned (or, if you don't need the floating
functionality, #GObject). If you have widgets that override the
destroy class handler, you have to adust your class_init function,
since destroy is now a member of GtkWidgetClass:
<informalexample><programlisting>
GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
object_class->destroy = my_destroy;
</programlisting></informalexample>
becomes
<informalexample><programlisting>
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
widget_class->destroy = my_destroy;
</programlisting></informalexample>
In the unlikely case that you have a non-widget class that is derived
from GtkObject and makes use of the destroy functionality, you have
to implement ::destroy yourself.
</para>
</section>
<section>
<title>Prevent mixed linkage</title>
<para>