[gtk+/gtkobject-removal: 2/5] Move destroy signal to GtkWidget



commit 50a464e76d12b14ae710dde1220cc84d46766b00
Author: Javier Jardón <jjardon gnome org>
Date:   Sat Sep 18 19:55:42 2010 -0400

    Move destroy signal to GtkWidget
    
    Also make GtkWidget derive from GInitiallyUnowned

 gtk/gtkaccellabel.c        |   16 +++----
 gtk/gtkassistant.c         |   17 +++-----
 gtk/gtkbutton.c            |   27 ++++++-------
 gtk/gtkcalendar.c          |   15 +++----
 gtk/gtkcolorsel.c          |   19 +++------
 gtk/gtkcombobox.c          |   13 ++----
 gtk/gtkcontainer.c         |   20 ++++-----
 gtk/gtkentry.c             |   15 +++----
 gtk/gtkexpander.c          |   18 +++-----
 gtk/gtkfilechooserbutton.c |   22 +++--------
 gtk/gtkhsv.c               |   17 +++-----
 gtk/gtkiconview.c          |   90 ++++++++++++++++++++------------------------
 gtk/gtkimage.c             |   20 ++++------
 gtk/gtkimagemenuitem.c     |   14 +++----
 gtk/gtkinvisible.c         |   12 ++---
 gtk/gtklabel.c             |   16 +++----
 gtk/gtkmenu.c              |   26 ++++++-------
 gtk/gtkmenuitem.c          |   14 +++----
 gtk/gtkmenutoolbutton.c    |   16 +++----
 gtk/gtknotebook.c          |   67 ++++++++++++++++----------------
 gtk/gtkpathbar.c           |    4 +-
 gtk/gtkradiobutton.c       |   15 +++----
 gtk/gtkradiomenuitem.c     |   22 +++++-----
 gtk/gtkrange.c             |   13 ++----
 gtk/gtkscrolledwindow.c    |   17 +++-----
 gtk/gtkstatusbar.c         |   13 ++----
 gtk/gtktextview.c          |   18 ++++-----
 gtk/gtktreeview.c          |   39 +++++++------------
 gtk/gtkviewport.c          |   14 +++----
 gtk/gtkwidget.c            |   47 +++++++++++++++++++---
 gtk/gtkwidget.h            |    5 +-
 gtk/gtkwindow.c            |   15 +++----
 32 files changed, 316 insertions(+), 380 deletions(-)
---
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c
index 475d36a..0d8cfe4 100644
--- a/gtk/gtkaccellabel.c
+++ b/gtk/gtkaccellabel.c
@@ -118,7 +118,7 @@ static void         gtk_accel_label_get_property (GObject            *object,
 						  guint               prop_id,
 						  GValue             *value,
 						  GParamSpec         *pspec);
-static void         gtk_accel_label_destroy      (GtkObject          *object);
+static void         gtk_accel_label_destroy      (GtkWidget          *widget);
 static void         gtk_accel_label_finalize     (GObject            *object);
 static gboolean     gtk_accel_label_expose_event (GtkWidget          *widget,
 						  GdkEventExpose     *event);
@@ -143,15 +143,13 @@ static void
 gtk_accel_label_class_init (GtkAccelLabelClass *class)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-  GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
   
   gobject_class->finalize = gtk_accel_label_finalize;
   gobject_class->set_property = gtk_accel_label_set_property;
   gobject_class->get_property = gtk_accel_label_get_property;
-  
-  object_class->destroy = gtk_accel_label_destroy;
-   
+
+  widget_class->destroy = gtk_accel_label_destroy;
   widget_class->expose_event = gtk_accel_label_expose_event;
 
   class->signal_quote1 = g_strdup ("<:");
@@ -292,14 +290,14 @@ gtk_accel_label_new (const gchar *string)
 }
 
 static void
-gtk_accel_label_destroy (GtkObject *object)
+gtk_accel_label_destroy (GtkWidget *widget)
 {
-  GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (object);
+  GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (widget);
 
   gtk_accel_label_set_accel_widget (accel_label, NULL);
   gtk_accel_label_set_accel_closure (accel_label, NULL);
-  
-  GTK_OBJECT_CLASS (gtk_accel_label_parent_class)->destroy (object);
+
+  GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index a866413..fb83631 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -114,7 +114,7 @@ struct _GtkAssistantPrivate
 
 static void     gtk_assistant_class_init         (GtkAssistantClass *class);
 static void     gtk_assistant_init               (GtkAssistant      *assistant);
-static void     gtk_assistant_destroy            (GtkObject         *object);
+static void     gtk_assistant_destroy            (GtkWidget         *widget);
 static void     gtk_assistant_style_set          (GtkWidget         *widget,
 						  GtkStyle          *old_style);
 static void     gtk_assistant_size_request       (GtkWidget         *widget,
@@ -200,17 +200,14 @@ static void
 gtk_assistant_class_init (GtkAssistantClass *class)
 {
   GObjectClass *gobject_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
   GtkContainerClass *container_class;
 
   gobject_class   = (GObjectClass *) class;
-  object_class    = (GtkObjectClass *) class;
   widget_class    = (GtkWidgetClass *) class;
   container_class = (GtkContainerClass *) class;
 
-  object_class->destroy = gtk_assistant_destroy;
-
+  widget_class->destroy = gtk_assistant_destroy;
   widget_class->style_set = gtk_assistant_style_set;
   widget_class->size_request = gtk_assistant_size_request;
   widget_class->size_allocate = gtk_assistant_size_allocate;
@@ -1005,9 +1002,9 @@ remove_page (GtkAssistant *assistant,
 }
 
 static void
-gtk_assistant_destroy (GtkObject *object)
+gtk_assistant_destroy (GtkWidget *widget)
 {
-  GtkAssistant *assistant = GTK_ASSISTANT (object);
+  GtkAssistant *assistant = GTK_ASSISTANT (widget);
   GtkAssistantPrivate *priv = assistant->priv;
 
   if (priv->header_image)
@@ -1056,9 +1053,9 @@ gtk_assistant_destroy (GtkObject *object)
   priv->current_page = NULL;
 
   while (priv->pages)
-    remove_page (GTK_ASSISTANT (object), priv->pages);
-      
-  GTK_OBJECT_CLASS (gtk_assistant_parent_class)->destroy (object);
+    remove_page (assistant, priv->pages);
+
+  GTK_WIDGET_CLASS (gtk_assistant_parent_class)->destroy (widget);
 }
 
 static GList*
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 0357d12..70419c5 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -109,7 +109,7 @@ struct _GtkButtonPrivate
   GtkAction      *action;
 };
 
-static void gtk_button_destroy        (GtkObject          *object);
+static void gtk_button_destroy        (GtkWidget          *widget);
 static void gtk_button_dispose        (GObject            *object);
 static void gtk_button_set_property   (GObject            *object,
                                        guint               prop_id,
@@ -192,12 +192,10 @@ static void
 gtk_button_class_init (GtkButtonClass *klass)
 {
   GObjectClass *gobject_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
   GtkContainerClass *container_class;
 
   gobject_class = G_OBJECT_CLASS (klass);
-  object_class = (GtkObjectClass*) klass;
   widget_class = (GtkWidgetClass*) klass;
   container_class = (GtkContainerClass*) klass;
   
@@ -206,8 +204,7 @@ gtk_button_class_init (GtkButtonClass *klass)
   gobject_class->set_property = gtk_button_set_property;
   gobject_class->get_property = gtk_button_get_property;
 
-  object_class->destroy = gtk_button_destroy;
-
+  widget_class->destroy = gtk_button_destroy;
   widget_class->screen_changed = gtk_button_screen_changed;
   widget_class->realize = gtk_button_realize;
   widget_class->unrealize = gtk_button_unrealize;
@@ -359,7 +356,7 @@ gtk_button_class_init (GtkButtonClass *klass)
    */ 
   button_signals[PRESSED] =
     g_signal_new (I_("pressed"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST,
 		  G_STRUCT_OFFSET (GtkButtonClass, pressed),
 		  NULL, NULL,
@@ -376,7 +373,7 @@ gtk_button_class_init (GtkButtonClass *klass)
    */ 
   button_signals[RELEASED] =
     g_signal_new (I_("released"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST,
 		  G_STRUCT_OFFSET (GtkButtonClass, released),
 		  NULL, NULL,
@@ -391,7 +388,7 @@ gtk_button_class_init (GtkButtonClass *klass)
    */ 
   button_signals[CLICKED] =
     g_signal_new (I_("clicked"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkButtonClass, clicked),
 		  NULL, NULL,
@@ -408,7 +405,7 @@ gtk_button_class_init (GtkButtonClass *klass)
    */ 
   button_signals[ENTER] =
     g_signal_new (I_("enter"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST,
 		  G_STRUCT_OFFSET (GtkButtonClass, enter),
 		  NULL, NULL,
@@ -425,7 +422,7 @@ gtk_button_class_init (GtkButtonClass *klass)
    */ 
   button_signals[LEAVE] =
     g_signal_new (I_("leave"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST,
 		  G_STRUCT_OFFSET (GtkButtonClass, leave),
 		  NULL, NULL,
@@ -443,7 +440,7 @@ gtk_button_class_init (GtkButtonClass *klass)
    */
   button_signals[ACTIVATE] =
     g_signal_new (I_("activate"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkButtonClass, activate),
 		  NULL, NULL,
@@ -588,17 +585,17 @@ gtk_button_init (GtkButton *button)
 }
 
 static void
-gtk_button_destroy (GtkObject *object)
+gtk_button_destroy (GtkWidget *widget)
 {
-  GtkButton *button = GTK_BUTTON (object);
-  
+  GtkButton *button = GTK_BUTTON (widget);
+
   if (button->label_text)
     {
       g_free (button->label_text);
       button->label_text = NULL;
     }
 
-  GTK_OBJECT_CLASS (gtk_button_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_button_parent_class)->destroy (widget);
 }
 
 static GObject*
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 2fe80ff..7368282 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -335,7 +335,7 @@ struct _GtkCalendarPrivate
 #define GTK_CALENDAR_GET_PRIVATE(widget)  (GTK_CALENDAR (widget)->priv)
 
 static void gtk_calendar_finalize     (GObject      *calendar);
-static void gtk_calendar_destroy      (GtkObject    *calendar);
+static void gtk_calendar_destroy      (GtkWidget    *widget);
 static void gtk_calendar_set_property (GObject      *object,
 				       guint         prop_id,
 				       const GValue *value,
@@ -432,19 +432,16 @@ static void
 gtk_calendar_class_init (GtkCalendarClass *class)
 {
   GObjectClass   *gobject_class;
-  GtkObjectClass   *object_class;
   GtkWidgetClass *widget_class;
 
   gobject_class = (GObjectClass*)  class;
-  object_class = (GtkObjectClass*)  class;
   widget_class = (GtkWidgetClass*) class;
   
   gobject_class->set_property = gtk_calendar_set_property;
   gobject_class->get_property = gtk_calendar_get_property;
   gobject_class->finalize = gtk_calendar_finalize;
 
-  object_class->destroy = gtk_calendar_destroy;
-
+  widget_class->destroy = gtk_calendar_destroy;
   widget_class->realize = gtk_calendar_realize;
   widget_class->unrealize = gtk_calendar_unrealize;
   widget_class->expose_event = gtk_calendar_expose;
@@ -1376,11 +1373,11 @@ gtk_calendar_finalize (GObject *object)
 }
 
 static void
-gtk_calendar_destroy (GtkObject *object)
+gtk_calendar_destroy (GtkWidget *widget)
 {
-  GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (object);
+  GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
 
-  calendar_stop_spinning (GTK_CALENDAR (object));
+  calendar_stop_spinning (GTK_CALENDAR (widget));
 
   /* Call the destroy function for the extra display callback: */
   if (priv->detail_func_destroy && priv->detail_func_user_data)
@@ -1390,7 +1387,7 @@ gtk_calendar_destroy (GtkObject *object)
       priv->detail_func_destroy = NULL;
     }
 
-  GTK_OBJECT_CLASS (gtk_calendar_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_calendar_parent_class)->destroy (widget);
 }
 
 
diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c
index 098ad33..bc1e6a5 100644
--- a/gtk/gtkcolorsel.c
+++ b/gtk/gtkcolorsel.c
@@ -159,7 +159,7 @@ struct _GtkColorSelectionPrivate
 };
 
 
-static void gtk_color_selection_destroy		(GtkObject		 *object);
+static void gtk_color_selection_destroy		(GtkWidget		 *widget);
 static void gtk_color_selection_finalize        (GObject		 *object);
 static void update_color			(GtkColorSelection	 *colorsel);
 static void gtk_color_selection_set_property    (GObject                 *object,
@@ -268,7 +268,6 @@ static void
 gtk_color_selection_class_init (GtkColorSelectionClass *klass)
 {
   GObjectClass *gobject_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
   
   gobject_class = G_OBJECT_CLASS (klass);
@@ -276,10 +275,8 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
   gobject_class->set_property = gtk_color_selection_set_property;
   gobject_class->get_property = gtk_color_selection_get_property;
 
-  object_class = GTK_OBJECT_CLASS (klass);
-  object_class->destroy = gtk_color_selection_destroy;
-  
   widget_class = GTK_WIDGET_CLASS (klass);
+  widget_class->destroy = gtk_color_selection_destroy;
   widget_class->realize = gtk_color_selection_realize;
   widget_class->unrealize = gtk_color_selection_unrealize;
   widget_class->show_all = gtk_color_selection_show_all;
@@ -316,7 +313,7 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
   
   color_selection_signals[COLOR_CHANGED] =
     g_signal_new (I_("color-changed"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST,
 		  G_STRUCT_OFFSET (GtkColorSelectionClass, color_changed),
 		  NULL, NULL,
@@ -584,12 +581,12 @@ gtk_color_selection_get_property (GObject     *object,
     }
 }
 
-/* GtkObject methods */
+/* GtkWidget methods */
 
 static void
-gtk_color_selection_destroy (GtkObject *object)
+gtk_color_selection_destroy (GtkWidget *widget)
 {
-  GtkColorSelection *cselection = GTK_COLOR_SELECTION (object);
+  GtkColorSelection *cselection = GTK_COLOR_SELECTION (widget);
   GtkColorSelectionPrivate *priv = cselection->private_data;
 
   if (priv->dropper_grab_widget)
@@ -598,11 +595,9 @@ gtk_color_selection_destroy (GtkObject *object)
       priv->dropper_grab_widget = NULL;
     }
 
-  GTK_OBJECT_CLASS (gtk_color_selection_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_color_selection_parent_class)->destroy (widget);
 }
 
-/* GtkWidget methods */
-
 static void
 gtk_color_selection_realize (GtkWidget *widget)
 {
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 0734d62..690dbfb 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -222,7 +222,7 @@ static void     gtk_combo_box_cell_layout_init     (GtkCellLayoutIface *iface);
 static void     gtk_combo_box_cell_editable_init   (GtkCellEditableIface *iface);
 static void     gtk_combo_box_dispose              (GObject          *object);
 static void     gtk_combo_box_finalize             (GObject          *object);
-static void     gtk_combo_box_destroy              (GtkObject        *object);
+static void     gtk_combo_box_destroy              (GtkWidget        *widget);
 
 static void     gtk_combo_box_set_property         (GObject         *object,
                                                     guint            prop_id,
@@ -500,7 +500,6 @@ static void
 gtk_combo_box_class_init (GtkComboBoxClass *klass)
 {
   GObjectClass *object_class;
-  GtkObjectClass *gtk_object_class;
   GtkContainerClass *container_class;
   GtkWidgetClass *widget_class;
   GtkBindingSet *binding_set;
@@ -520,9 +519,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
   widget_class->grab_focus = gtk_combo_box_grab_focus;
   widget_class->style_set = gtk_combo_box_style_set;
   widget_class->state_changed = gtk_combo_box_state_changed;
-
-  gtk_object_class = (GtkObjectClass *)klass;
-  gtk_object_class->destroy = gtk_combo_box_destroy;
+  widget_class->destroy = gtk_combo_box_destroy;
 
   object_class = (GObjectClass *)klass;
   object_class->dispose = gtk_combo_box_dispose;
@@ -5426,9 +5423,9 @@ gtk_combo_box_grab_focus (GtkWidget *widget)
 }
 
 static void
-gtk_combo_box_destroy (GtkObject *object)
+gtk_combo_box_destroy (GtkWidget *widget)
 {
-  GtkComboBox *combo_box = GTK_COMBO_BOX (object);
+  GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
 
   if (combo_box->priv->popup_idle_id > 0)
     {
@@ -5445,7 +5442,7 @@ gtk_combo_box_destroy (GtkObject *object)
   combo_box->priv->row_separator_data = NULL;
   combo_box->priv->row_separator_destroy = NULL;
 
-  GTK_OBJECT_CLASS (gtk_combo_box_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_combo_box_parent_class)->destroy (widget);
   combo_box->priv->cell_view = NULL;
 }
 
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 38a5f9a..35871f6 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -80,7 +80,7 @@ static void     gtk_container_base_class_init      (GtkContainerClass *klass);
 static void     gtk_container_base_class_finalize  (GtkContainerClass *klass);
 static void     gtk_container_class_init           (GtkContainerClass *klass);
 static void     gtk_container_init                 (GtkContainer      *container);
-static void     gtk_container_destroy              (GtkObject         *object);
+static void     gtk_container_destroy              (GtkWidget         *widget);
 static void     gtk_container_set_property         (GObject         *object,
 						    guint            prop_id,
 						    const GValue    *value,
@@ -224,7 +224,6 @@ static void
 gtk_container_class_init (GtkContainerClass *class)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-  GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
 
   parent_class = g_type_class_peek_parent (class);
@@ -235,8 +234,7 @@ gtk_container_class_init (GtkContainerClass *class)
   gobject_class->set_property = gtk_container_set_property;
   gobject_class->get_property = gtk_container_get_property;
 
-  object_class->destroy = gtk_container_destroy;
-
+  widget_class->destroy = gtk_container_destroy;
   widget_class->show_all = gtk_container_show_all;
   widget_class->hide_all = gtk_container_hide_all;
   widget_class->expose_event = gtk_container_expose;
@@ -281,7 +279,7 @@ gtk_container_class_init (GtkContainerClass *class)
 						      GTK_PARAM_WRITABLE));
   container_signals[ADD] =
     g_signal_new (I_("add"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST,
 		  G_STRUCT_OFFSET (GtkContainerClass, add),
 		  NULL, NULL,
@@ -290,7 +288,7 @@ gtk_container_class_init (GtkContainerClass *class)
 		  GTK_TYPE_WIDGET);
   container_signals[REMOVE] =
     g_signal_new (I_("remove"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST,
 		  G_STRUCT_OFFSET (GtkContainerClass, remove),
 		  NULL, NULL,
@@ -299,7 +297,7 @@ gtk_container_class_init (GtkContainerClass *class)
 		  GTK_TYPE_WIDGET);
   container_signals[CHECK_RESIZE] =
     g_signal_new (I_("check-resize"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_LAST,
 		  G_STRUCT_OFFSET (GtkContainerClass, check_resize),
 		  NULL, NULL,
@@ -307,7 +305,7 @@ gtk_container_class_init (GtkContainerClass *class)
 		  G_TYPE_NONE, 0);
   container_signals[SET_FOCUS_CHILD] =
     g_signal_new (I_("set-focus-child"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST,
 		  G_STRUCT_OFFSET (GtkContainerClass, set_focus_child),
 		  NULL, NULL,
@@ -1083,9 +1081,9 @@ gtk_container_init (GtkContainer *container)
 }
 
 static void
-gtk_container_destroy (GtkObject *object)
+gtk_container_destroy (GtkWidget *widget)
 {
-  GtkContainer *container = GTK_CONTAINER (object);
+  GtkContainer *container = GTK_CONTAINER (widget);
   GtkContainerPrivate *priv = container->priv;
 
   if (GTK_CONTAINER_RESIZE_PENDING (container))
@@ -1105,7 +1103,7 @@ gtk_container_destroy (GtkObject *object)
 
   gtk_container_foreach (container, (GtkCallback) gtk_widget_destroy, NULL);
 
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index fddf25c..9d29e69 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -237,7 +237,7 @@ typedef enum
   DISPLAY_BLANK         /* In invisible mode, nothing shown at all */
 } DisplayMode;
 
-/* GObject, GtkObject methods
+/* GObject methods
  */
 static void   gtk_entry_editable_init        (GtkEditableInterface *iface);
 static void   gtk_entry_cell_editable_init   (GtkCellEditableIface *iface);
@@ -250,11 +250,11 @@ static void   gtk_entry_get_property         (GObject          *object,
                                               GValue           *value,
                                               GParamSpec       *pspec);
 static void   gtk_entry_finalize             (GObject          *object);
-static void   gtk_entry_destroy              (GtkObject        *object);
 static void   gtk_entry_dispose              (GObject          *object);
 
 /* GtkWidget methods
  */
+static void   gtk_entry_destroy              (GtkWidget        *widget);
 static void   gtk_entry_realize              (GtkWidget        *widget);
 static void   gtk_entry_unrealize            (GtkWidget        *widget);
 static void   gtk_entry_map                  (GtkWidget        *widget);
@@ -562,17 +562,16 @@ gtk_entry_class_init (GtkEntryClass *class)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (class);
   GtkWidgetClass *widget_class;
-  GtkObjectClass *gtk_object_class;
   GtkBindingSet *binding_set;
 
   widget_class = (GtkWidgetClass*) class;
-  gtk_object_class = (GtkObjectClass *)class;
 
   gobject_class->dispose = gtk_entry_dispose;
   gobject_class->finalize = gtk_entry_finalize;
   gobject_class->set_property = gtk_entry_set_property;
   gobject_class->get_property = gtk_entry_get_property;
 
+  widget_class->destroy = gtk_entry_destroy;
   widget_class->map = gtk_entry_map;
   widget_class->unmap = gtk_entry_unmap;
   widget_class->realize = gtk_entry_realize;
@@ -608,8 +607,6 @@ gtk_entry_class_init (GtkEntryClass *class)
 
   widget_class->popup_menu = gtk_entry_popup_menu;
 
-  gtk_object_class->destroy = gtk_entry_destroy;
-
   class->move_cursor = gtk_entry_move_cursor;
   class->insert_at_cursor = gtk_entry_insert_at_cursor;
   class->delete_from_cursor = gtk_entry_delete_from_cursor;
@@ -2423,9 +2420,9 @@ emit_changed (GtkEntry *entry)
 }
 
 static void
-gtk_entry_destroy (GtkObject *object)
+gtk_entry_destroy (GtkWidget *widget)
 {
-  GtkEntry *entry = GTK_ENTRY (object);
+  GtkEntry *entry = GTK_ENTRY (widget);
 
   entry->current_pos = entry->selection_bound = 0;
   _gtk_entry_reset_im_context (entry);
@@ -2443,7 +2440,7 @@ gtk_entry_destroy (GtkObject *object)
       entry->recompute_idle = 0;
     }
 
-  GTK_OBJECT_CLASS (gtk_entry_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_entry_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index e8f90bd..f87cae8 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -79,8 +79,7 @@ static void gtk_expander_get_property (GObject          *object,
 				       GValue           *value,
 				       GParamSpec       *pspec);
 
-static void gtk_expander_destroy (GtkObject *object);
-
+static void     gtk_expander_destroy        (GtkWidget        *widget);
 static void     gtk_expander_realize        (GtkWidget        *widget);
 static void     gtk_expander_unrealize      (GtkWidget        *widget);
 static void     gtk_expander_size_allocate  (GtkWidget        *widget,
@@ -161,20 +160,17 @@ static void
 gtk_expander_class_init (GtkExpanderClass *klass)
 {
   GObjectClass *gobject_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
   GtkContainerClass *container_class;
 
   gobject_class   = (GObjectClass *) klass;
-  object_class    = (GtkObjectClass *) klass;
   widget_class    = (GtkWidgetClass *) klass;
   container_class = (GtkContainerClass *) klass;
 
   gobject_class->set_property = gtk_expander_set_property;
   gobject_class->get_property = gtk_expander_get_property;
 
-  object_class->destroy = gtk_expander_destroy;
-
+  widget_class->destroy              = gtk_expander_destroy;
   widget_class->realize              = gtk_expander_realize;
   widget_class->unrealize            = gtk_expander_unrealize;
   widget_class->size_allocate        = gtk_expander_size_allocate;
@@ -414,17 +410,17 @@ gtk_expander_get_property (GObject    *object,
 }
 
 static void
-gtk_expander_destroy (GtkObject *object)
+gtk_expander_destroy (GtkWidget *widget)
 {
-  GtkExpanderPrivate *priv = GTK_EXPANDER (object)->priv;
-  
+  GtkExpanderPrivate *priv = GTK_EXPANDER (widget)->priv;
+
   if (priv->animation_timeout)
     {
       g_source_remove (priv->animation_timeout);
       priv->animation_timeout = 0;
     }
-  
-  GTK_OBJECT_CLASS (gtk_expander_parent_class)->destroy (object);
+
+  GTK_WIDGET_CLASS (gtk_expander_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c
index 217f8b2..f2af98a 100644
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@ -207,10 +207,8 @@ static void     gtk_file_chooser_button_get_property       (GObject          *ob
 							    GParamSpec       *pspec);
 static void     gtk_file_chooser_button_finalize           (GObject          *object);
 
-/* GtkObject Functions */
-static void     gtk_file_chooser_button_destroy            (GtkObject        *object);
-
 /* GtkWidget Functions */
+static void     gtk_file_chooser_button_destroy            (GtkWidget        *widget);
 static void     gtk_file_chooser_button_drag_data_received (GtkWidget        *widget,
 							    GdkDragContext   *context,
 							    gint              x,
@@ -317,11 +315,9 @@ static void
 gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
 {
   GObjectClass *gobject_class;
-  GtkObjectClass *gtkobject_class;
   GtkWidgetClass *widget_class;
 
   gobject_class = G_OBJECT_CLASS (class);
-  gtkobject_class = GTK_OBJECT_CLASS (class);
   widget_class = GTK_WIDGET_CLASS (class);
 
   gobject_class->constructor = gtk_file_chooser_button_constructor;
@@ -329,8 +325,7 @@ gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
   gobject_class->get_property = gtk_file_chooser_button_get_property;
   gobject_class->finalize = gtk_file_chooser_button_finalize;
 
-  gtkobject_class->destroy = gtk_file_chooser_button_destroy;
-
+  widget_class->destroy = gtk_file_chooser_button_destroy;
   widget_class->drag_data_received = gtk_file_chooser_button_drag_data_received;
   widget_class->show_all = gtk_file_chooser_button_show_all;
   widget_class->hide_all = gtk_file_chooser_button_hide_all;
@@ -883,13 +878,13 @@ gtk_file_chooser_button_finalize (GObject *object)
 }
 
 /* ********************* *
- *  GtkObject Functions  *
+ *  GtkWidget Functions  *
  * ********************* */
 
 static void
-gtk_file_chooser_button_destroy (GtkObject *object)
+gtk_file_chooser_button_destroy (GtkWidget *widget)
 {
-  GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (object);
+  GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (widget);
   GtkFileChooserButtonPrivate *priv = button->priv;
   GtkTreeIter iter;
   GSList *l;
@@ -949,14 +944,9 @@ gtk_file_chooser_button_destroy (GtkObject *object)
       priv->fs = NULL;
     }
 
-  GTK_OBJECT_CLASS (gtk_file_chooser_button_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_file_chooser_button_parent_class)->destroy (widget);
 }
 
-
-/* ********************* *
- *  GtkWidget Functions  *
- * ********************* */
-
 struct DndSelectFolderData
 {
   GtkFileSystem *file_system;
diff --git a/gtk/gtkhsv.c b/gtk/gtkhsv.c
index 49a8122..4819125 100644
--- a/gtk/gtkhsv.c
+++ b/gtk/gtkhsv.c
@@ -85,7 +85,7 @@ enum {
   LAST_SIGNAL
 };
 
-static void     gtk_hsv_destroy        (GtkObject        *object);
+static void     gtk_hsv_destroy        (GtkWidget        *widget);
 static void     gtk_hsv_map            (GtkWidget        *widget);
 static void     gtk_hsv_unmap          (GtkWidget        *widget);
 static void     gtk_hsv_realize        (GtkWidget        *widget);
@@ -118,18 +118,15 @@ static void
 gtk_hsv_class_init (GtkHSVClass *class)
 {
   GObjectClass   *gobject_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
   GtkHSVClass    *hsv_class;
   GtkBindingSet  *binding_set;
   
   gobject_class = (GObjectClass *) class;
-  object_class = (GtkObjectClass *) class;
   widget_class = (GtkWidgetClass *) class;
   hsv_class = GTK_HSV_CLASS (class);
-  
-  object_class->destroy = gtk_hsv_destroy;
-  
+
+  widget_class->destroy = gtk_hsv_destroy;
   widget_class->map = gtk_hsv_map;
   widget_class->unmap = gtk_hsv_unmap;                                      
   widget_class->realize = gtk_hsv_realize;
@@ -147,7 +144,7 @@ gtk_hsv_class_init (GtkHSVClass *class)
   
   hsv_signals[CHANGED] =
     g_signal_new (I_("changed"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST,
 		  G_STRUCT_OFFSET (GtkHSVClass, changed),
 		  NULL, NULL,
@@ -156,7 +153,7 @@ gtk_hsv_class_init (GtkHSVClass *class)
 
   hsv_signals[MOVE] =
     g_signal_new (I_("move"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkHSVClass, move),
 		  NULL, NULL,
@@ -221,9 +218,9 @@ gtk_hsv_init (GtkHSV *hsv)
 
 /* Destroy handler for the HSV color selector */
 static void
-gtk_hsv_destroy (GtkObject *object)
+gtk_hsv_destroy (GtkWidget *widget)
 {
-  GTK_OBJECT_CLASS (gtk_hsv_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_hsv_parent_class)->destroy (widget);
 }
 
 /* Default signal handlers */
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 522c517..e2a90e1 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -246,11 +246,8 @@ static void             gtk_icon_view_get_property              (GObject
 								 guint               prop_id,
 								 GValue             *value,
 								 GParamSpec         *pspec);
-
-/* GtkObject vfuncs */
-static void             gtk_icon_view_destroy                   (GtkObject          *object);
-
 /* GtkWidget vfuncs */
+static void             gtk_icon_view_destroy                   (GtkWidget          *widget);
 static void             gtk_icon_view_realize                   (GtkWidget          *widget);
 static void             gtk_icon_view_unrealize                 (GtkWidget          *widget);
 static void             gtk_icon_view_style_set                 (GtkWidget        *widget,
@@ -492,7 +489,6 @@ static void
 gtk_icon_view_class_init (GtkIconViewClass *klass)
 {
   GObjectClass *gobject_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
   GtkContainerClass *container_class;
   GtkBindingSet *binding_set;
@@ -502,7 +498,6 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
   g_type_class_add_private (klass, sizeof (GtkIconViewPrivate));
 
   gobject_class = (GObjectClass *) klass;
-  object_class = (GtkObjectClass *) klass;
   widget_class = (GtkWidgetClass *) klass;
   container_class = (GtkContainerClass *) klass;
 
@@ -510,8 +505,7 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
   gobject_class->set_property = gtk_icon_view_set_property;
   gobject_class->get_property = gtk_icon_view_get_property;
 
-  object_class->destroy = gtk_icon_view_destroy;
-  
+  widget_class->destroy = gtk_icon_view_destroy;
   widget_class->realize = gtk_icon_view_realize;
   widget_class->unrealize = gtk_icon_view_unrealize;
   widget_class->style_set = gtk_icon_view_style_set;
@@ -1141,46 +1135,6 @@ gtk_icon_view_init (GtkIconView *icon_view)
   icon_view->priv->draw_focus = TRUE;
 }
 
-static void
-gtk_icon_view_destroy (GtkObject *object)
-{
-  GtkIconView *icon_view;
-
-  icon_view = GTK_ICON_VIEW (object);
-  
-  gtk_icon_view_stop_editing (icon_view, TRUE);
-
-  gtk_icon_view_set_model (icon_view, NULL);
-  
-  if (icon_view->priv->layout_idle_id != 0)
-    {
-      g_source_remove (icon_view->priv->layout_idle_id);
-      icon_view->priv->layout_idle_id = 0;
-    }
-
-  if (icon_view->priv->scroll_to_path != NULL)
-    {
-      gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
-      icon_view->priv->scroll_to_path = NULL;
-    }
-
-  remove_scroll_timeout (icon_view);
-
-  if (icon_view->priv->hadjustment != NULL)
-    {
-      g_object_unref (icon_view->priv->hadjustment);
-      icon_view->priv->hadjustment = NULL;
-    }
-
-  if (icon_view->priv->vadjustment != NULL)
-    {
-      g_object_unref (icon_view->priv->vadjustment);
-      icon_view->priv->vadjustment = NULL;
-    }
-  
-  GTK_OBJECT_CLASS (gtk_icon_view_parent_class)->destroy (object);
-}
-
 /* GObject methods */
 static void
 gtk_icon_view_finalize (GObject *object)
@@ -1322,7 +1276,45 @@ gtk_icon_view_get_property (GObject      *object,
     }
 }
 
-/* GtkWidget signals */
+/* GtkWidget methods */
+static void
+gtk_icon_view_destroy (GtkWidget *widget)
+{
+  GtkIconView *icon_view = GTK_ICON_VIEW (widget);
+
+  gtk_icon_view_stop_editing (icon_view, TRUE);
+
+  gtk_icon_view_set_model (icon_view, NULL);
+
+  if (icon_view->priv->layout_idle_id != 0)
+    {
+      g_source_remove (icon_view->priv->layout_idle_id);
+      icon_view->priv->layout_idle_id = 0;
+    }
+
+  if (icon_view->priv->scroll_to_path != NULL)
+    {
+      gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
+      icon_view->priv->scroll_to_path = NULL;
+    }
+
+  remove_scroll_timeout (icon_view);
+
+  if (icon_view->priv->hadjustment != NULL)
+    {
+      g_object_unref (icon_view->priv->hadjustment);
+      icon_view->priv->hadjustment = NULL;
+    }
+
+  if (icon_view->priv->vadjustment != NULL)
+    {
+      g_object_unref (icon_view->priv->vadjustment);
+      icon_view->priv->vadjustment = NULL;
+    }
+
+  GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->destroy (widget);
+}
+
 static void
 gtk_icon_view_realize (GtkWidget *widget)
 {
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index c947f02..ea4ec19 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -167,7 +167,7 @@ static void gtk_image_style_set    (GtkWidget      *widget,
 				    GtkStyle       *prev_style);
 static void gtk_image_screen_changed (GtkWidget    *widget,
 				      GdkScreen    *prev_screen);
-static void gtk_image_destroy      (GtkObject      *object);
+static void gtk_image_destroy      (GtkWidget      *widget);
 static void gtk_image_reset        (GtkImage       *image);
 static void gtk_image_calc_size    (GtkImage       *image);
 
@@ -209,20 +209,16 @@ static void
 gtk_image_class_init (GtkImageClass *class)
 {
   GObjectClass *gobject_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
 
   gobject_class = G_OBJECT_CLASS (class);
   
   gobject_class->set_property = gtk_image_set_property;
   gobject_class->get_property = gtk_image_get_property;
-  
-  object_class = GTK_OBJECT_CLASS (class);
-  
-  object_class->destroy = gtk_image_destroy;
 
   widget_class = GTK_WIDGET_CLASS (class);
-  
+
+  widget_class->destroy = gtk_image_destroy;
   widget_class->expose_event = gtk_image_expose;
   widget_class->size_request = gtk_image_size_request;
   widget_class->unmap = gtk_image_unmap;
@@ -355,7 +351,7 @@ gtk_image_class_init (GtkImageClass *class)
                                                       GTK_IMAGE_EMPTY,
                                                       GTK_PARAM_READABLE));
 
-  g_type_class_add_private (object_class, sizeof (GtkImagePrivate));
+  g_type_class_add_private (class, sizeof (GtkImagePrivate));
 }
 
 static void
@@ -380,13 +376,13 @@ gtk_image_init (GtkImage *image)
 }
 
 static void
-gtk_image_destroy (GtkObject *object)
+gtk_image_destroy (GtkWidget *widget)
 {
-  GtkImage *image = GTK_IMAGE (object);
+  GtkImage *image = GTK_IMAGE (widget);
 
   gtk_image_reset (image);
-  
-  GTK_OBJECT_CLASS (gtk_image_parent_class)->destroy (object);
+
+  GTK_WIDGET_CLASS (gtk_image_parent_class)->destroy (widget);
 }
 
 static void 
diff --git a/gtk/gtkimagemenuitem.c b/gtk/gtkimagemenuitem.c
index 311221f..5ed00b3 100644
--- a/gtk/gtkimagemenuitem.c
+++ b/gtk/gtkimagemenuitem.c
@@ -62,7 +62,7 @@ enum {
 
 static GtkActivatableIface *parent_activatable_iface;
 
-static void gtk_image_menu_item_destroy              (GtkObject        *object);
+static void gtk_image_menu_item_destroy              (GtkWidget        *widget);
 static void gtk_image_menu_item_size_request         (GtkWidget        *widget,
                                                       GtkRequisition   *requisition);
 static void gtk_image_menu_item_size_allocate        (GtkWidget        *widget,
@@ -112,13 +112,11 @@ static void
 gtk_image_menu_item_class_init (GtkImageMenuItemClass *klass)
 {
   GObjectClass *gobject_class = (GObjectClass*) klass;
-  GtkObjectClass *object_class = (GtkObjectClass*) klass;
   GtkWidgetClass *widget_class = (GtkWidgetClass*) klass;
   GtkMenuItemClass *menu_item_class = (GtkMenuItemClass*) klass;
   GtkContainerClass *container_class = (GtkContainerClass*) klass;
 
-  object_class->destroy = gtk_image_menu_item_destroy;
-
+  widget_class->destroy = gtk_image_menu_item_destroy;
   widget_class->screen_changed = gtk_image_menu_item_screen_changed;
   widget_class->size_request = gtk_image_menu_item_size_request;
   widget_class->size_allocate = gtk_image_menu_item_size_allocate;
@@ -198,7 +196,7 @@ gtk_image_menu_item_class_init (GtkImageMenuItemClass *klass)
 						       TRUE,
 						       GTK_PARAM_READWRITE));
 
-  g_type_class_add_private (object_class, sizeof (GtkImageMenuItemPrivate));
+  g_type_class_add_private (klass, sizeof (GtkImageMenuItemPrivate));
 }
 
 static void
@@ -310,16 +308,16 @@ gtk_image_menu_item_map (GtkWidget *widget)
 }
 
 static void
-gtk_image_menu_item_destroy (GtkObject *object)
+gtk_image_menu_item_destroy (GtkWidget *widget)
 {
-  GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (object);
+  GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (widget);
   GtkImageMenuItemPrivate *priv = image_menu_item->priv;
 
   if (priv->image)
     gtk_container_remove (GTK_CONTAINER (image_menu_item),
                           priv->image);
 
-  GTK_OBJECT_CLASS (gtk_image_menu_item_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtkinvisible.c b/gtk/gtkinvisible.c
index dc349e9..c8d7258 100644
--- a/gtk/gtkinvisible.c
+++ b/gtk/gtkinvisible.c
@@ -42,7 +42,7 @@ enum {
   LAST_ARG
 };
 
-static void gtk_invisible_destroy       (GtkObject         *object);
+static void gtk_invisible_destroy       (GtkWidget         *widget);
 static void gtk_invisible_realize       (GtkWidget         *widget);
 static void gtk_invisible_style_set     (GtkWidget         *widget,
 					 GtkStyle          *previous_style);
@@ -68,19 +68,17 @@ static void
 gtk_invisible_class_init (GtkInvisibleClass *class)
 {
   GObjectClass	 *gobject_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
 
   widget_class = (GtkWidgetClass*) class;
-  object_class = (GtkObjectClass*) class;
   gobject_class = (GObjectClass*) class;
 
   widget_class->realize = gtk_invisible_realize;
   widget_class->style_set = gtk_invisible_style_set;
   widget_class->show = gtk_invisible_show;
   widget_class->size_allocate = gtk_invisible_size_allocate;
+  widget_class->destroy = gtk_invisible_destroy;
 
-  object_class->destroy = gtk_invisible_destroy;
   gobject_class->set_property = gtk_invisible_set_property;
   gobject_class->get_property = gtk_invisible_get_property;
   gobject_class->constructor = gtk_invisible_constructor;
@@ -121,9 +119,9 @@ gtk_invisible_init (GtkInvisible *invisible)
 }
 
 static void
-gtk_invisible_destroy (GtkObject *object)
+gtk_invisible_destroy (GtkWidget *widget)
 {
-  GtkInvisible *invisible = GTK_INVISIBLE (object);
+  GtkInvisible *invisible = GTK_INVISIBLE (widget);
   GtkInvisiblePrivate *priv = invisible->priv;
 
   if (priv->has_user_ref_count)
@@ -132,7 +130,7 @@ gtk_invisible_destroy (GtkObject *object)
       g_object_unref (invisible);
     }
 
-  GTK_OBJECT_CLASS (gtk_invisible_parent_class)->destroy (object);  
+  GTK_WIDGET_CLASS (gtk_invisible_parent_class)->destroy (widget);
 }
 
 /**
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 9899681..9fe542c 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -198,8 +198,8 @@ static void gtk_label_get_property      (GObject          *object,
 					 guint             prop_id,
 					 GValue           *value,
 					 GParamSpec       *pspec);
-static void gtk_label_destroy           (GtkObject        *object);
 static void gtk_label_finalize          (GObject          *object);
+static void gtk_label_destroy           (GtkWidget        *widget);
 static void gtk_label_size_allocate     (GtkWidget        *widget,
                                          GtkAllocation    *allocation);
 static void gtk_label_state_changed     (GtkWidget        *widget,
@@ -383,7 +383,6 @@ static void
 gtk_label_class_init (GtkLabelClass *class)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-  GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
   GtkBindingSet *binding_set;
 
@@ -391,8 +390,7 @@ gtk_label_class_init (GtkLabelClass *class)
   gobject_class->get_property = gtk_label_get_property;
   gobject_class->finalize = gtk_label_finalize;
 
-  object_class->destroy = gtk_label_destroy;
-
+  widget_class->destroy = gtk_label_destroy;
   widget_class->size_allocate = gtk_label_size_allocate;
   widget_class->state_changed = gtk_label_state_changed;
   widget_class->style_set = gtk_label_style_set;
@@ -515,7 +513,7 @@ gtk_label_class_init (GtkLabelClass *class)
      */
     signals[ACTIVATE_CURRENT_LINK] =
       g_signal_new_class_handler ("activate-current-link",
-                                  G_TYPE_FROM_CLASS (object_class),
+                                  G_TYPE_FROM_CLASS (gobject_class),
                                   G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                                   G_CALLBACK (gtk_label_activate_current_link),
                                   NULL, NULL,
@@ -537,7 +535,7 @@ gtk_label_class_init (GtkLabelClass *class)
      */
     signals[ACTIVATE_LINK] =
       g_signal_new ("activate-link",
-                    G_TYPE_FROM_CLASS (object_class),
+                    G_TYPE_FROM_CLASS (gobject_class),
                     G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GtkLabelClass, activate_link),
                     _gtk_boolean_handled_accumulator, NULL,
@@ -2950,13 +2948,13 @@ gtk_label_get_line_wrap_mode (GtkLabel *label)
 }
 
 static void
-gtk_label_destroy (GtkObject *object)
+gtk_label_destroy (GtkWidget *widget)
 {
-  GtkLabel *label = GTK_LABEL (object);
+  GtkLabel *label = GTK_LABEL (widget);
 
   gtk_label_set_mnemonic_widget (label, NULL);
 
-  GTK_OBJECT_CLASS (gtk_label_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_label_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 2e809b2..8a15482 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -170,7 +170,7 @@ static void     gtk_menu_get_child_property(GtkContainer     *container,
                                             guint             property_id,
                                             GValue           *value,
                                             GParamSpec       *pspec);
-static void     gtk_menu_destroy           (GtkObject        *object);
+static void     gtk_menu_destroy           (GtkWidget        *widget);
 static void     gtk_menu_realize           (GtkWidget        *widget);
 static void     gtk_menu_unrealize         (GtkWidget        *widget);
 static void     gtk_menu_size_allocate     (GtkWidget        *widget,
@@ -463,7 +463,6 @@ static void
 gtk_menu_class_init (GtkMenuClass *class)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-  GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
   GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
   GtkMenuShellClass *menu_shell_class = GTK_MENU_SHELL_CLASS (class);
@@ -472,8 +471,7 @@ gtk_menu_class_init (GtkMenuClass *class)
   gobject_class->set_property = gtk_menu_set_property;
   gobject_class->get_property = gtk_menu_get_property;
 
-  object_class->destroy = gtk_menu_destroy;
-  
+  widget_class->destroy = gtk_menu_destroy;
   widget_class->realize = gtk_menu_realize;
   widget_class->unrealize = gtk_menu_unrealize;
   widget_class->size_allocate = gtk_menu_size_allocate;
@@ -506,7 +504,7 @@ gtk_menu_class_init (GtkMenuClass *class)
 
   menu_signals[MOVE_SCROLL] =
     g_signal_new_class_handler (I_("move-scroll"),
-                                G_OBJECT_CLASS_TYPE (object_class),
+                                G_OBJECT_CLASS_TYPE (gobject_class),
                                 G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                                 G_CALLBACK (gtk_menu_real_move_scroll),
                                 NULL, NULL,
@@ -1083,15 +1081,15 @@ gtk_menu_init (GtkMenu *menu)
 }
 
 static void
-gtk_menu_destroy (GtkObject *object)
+gtk_menu_destroy (GtkWidget *widget)
 {
-  GtkMenu *menu = GTK_MENU (object);
+  GtkMenu *menu = GTK_MENU (widget);
   GtkMenuAttachData *data;
   GtkMenuPrivate *priv; 
 
   gtk_menu_remove_scroll_timeout (menu);
   
-  data = g_object_get_data (G_OBJECT (object), attach_data_key);
+  data = g_object_get_data (G_OBJECT (widget), attach_data_key);
   if (data)
     gtk_menu_detach (menu);
   
@@ -1107,7 +1105,7 @@ gtk_menu_destroy (GtkObject *object)
   if (menu->needs_destruction_ref_count)
     {
       menu->needs_destruction_ref_count = FALSE;
-      g_object_ref (object);
+      g_object_ref (widget);
     }
   
   if (menu->accel_group)
@@ -1136,7 +1134,7 @@ gtk_menu_destroy (GtkObject *object)
       priv->title = NULL;
     }
 
-  GTK_OBJECT_CLASS (gtk_menu_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_menu_parent_class)->destroy (widget);
 }
 
 static void
@@ -5119,7 +5117,7 @@ gtk_menu_reparent (GtkMenu   *menu,
                    GtkWidget *new_parent,
                    gboolean   unrealize)
 {
-  GtkObject *object = GTK_OBJECT (menu);
+  GObject *object = G_OBJECT (menu);
   GtkWidget *widget = GTK_WIDGET (menu);
   gboolean was_floating = g_object_is_floating (object);
 
@@ -5133,10 +5131,10 @@ gtk_menu_reparent (GtkMenu   *menu,
       g_object_unref (object);
     }
   else
-    gtk_widget_reparent (GTK_WIDGET (menu), new_parent);
-  
+    gtk_widget_reparent (widget, new_parent);
+
   if (was_floating)
-    g_object_force_floating (G_OBJECT (object));
+    g_object_force_floating (object);
   else
     g_object_unref (object);
 }
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index 02b3a24..967b445 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -79,7 +79,7 @@ static void gtk_menu_item_get_property   (GObject          *object,
 					  guint             prop_id,
 					  GValue           *value,
 					  GParamSpec       *pspec);
-static void gtk_menu_item_destroy        (GtkObject        *object);
+static void gtk_menu_item_destroy        (GtkWidget        *widget);
 static void gtk_menu_item_size_allocate  (GtkWidget        *widget,
 					  GtkAllocation    *allocation);
 static void gtk_menu_item_realize        (GtkWidget        *widget);
@@ -183,7 +183,6 @@ static void
 gtk_menu_item_class_init (GtkMenuItemClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-  GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
   GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
 
@@ -191,8 +190,7 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
   gobject_class->set_property = gtk_menu_item_set_property;
   gobject_class->get_property = gtk_menu_item_get_property;
 
-  object_class->destroy = gtk_menu_item_destroy;
-
+  widget_class->destroy = gtk_menu_item_destroy;
   widget_class->size_allocate = gtk_menu_item_size_allocate;
   widget_class->expose_event = gtk_menu_item_expose;
   widget_class->realize = gtk_menu_item_realize;
@@ -417,7 +415,7 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
                                                              0, G_MAXINT, 12,
                                                              GTK_PARAM_READABLE));
 
-  g_type_class_add_private (object_class, sizeof (GtkMenuItemPrivate));
+  g_type_class_add_private (klass, sizeof (GtkMenuItemPrivate));
 }
 
 static void
@@ -570,14 +568,14 @@ gtk_menu_item_get_property (GObject    *object,
 }
 
 static void
-gtk_menu_item_destroy (GtkObject *object)
+gtk_menu_item_destroy (GtkWidget *widget)
 {
-  GtkMenuItem *menu_item = GTK_MENU_ITEM (object);
+  GtkMenuItem *menu_item = GTK_MENU_ITEM (widget);
 
   if (menu_item->submenu)
     gtk_widget_destroy (menu_item->submenu);
 
-  GTK_OBJECT_CLASS (gtk_menu_item_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_menu_item_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtkmenutoolbutton.c b/gtk/gtkmenutoolbutton.c
index bc2b98f..7259999 100644
--- a/gtk/gtkmenutoolbutton.c
+++ b/gtk/gtkmenutoolbutton.c
@@ -44,7 +44,7 @@ struct _GtkMenuToolButtonPrivate
   GtkMenu   *menu;
 };
 
-static void gtk_menu_tool_button_destroy    (GtkObject              *object);
+static void gtk_menu_tool_button_destroy    (GtkWidget              *widget);
 
 static int  menu_deactivate_cb              (GtkMenuShell           *menu_shell,
 					     GtkMenuToolButton      *button);
@@ -203,19 +203,19 @@ static void
 gtk_menu_tool_button_class_init (GtkMenuToolButtonClass *klass)
 {
   GObjectClass *object_class;
-  GtkObjectClass *gtk_object_class;
   GtkWidgetClass *widget_class;
   GtkToolItemClass *toolitem_class;
 
   object_class = (GObjectClass *)klass;
-  gtk_object_class = (GtkObjectClass *)klass;
   widget_class = (GtkWidgetClass *)klass;
   toolitem_class = (GtkToolItemClass *)klass;
 
   object_class->set_property = gtk_menu_tool_button_set_property;
   object_class->get_property = gtk_menu_tool_button_get_property;
-  gtk_object_class->destroy = gtk_menu_tool_button_destroy;
+
+  widget_class->destroy = gtk_menu_tool_button_destroy;
   widget_class->state_changed = gtk_menu_tool_button_state_changed;
+
   toolitem_class->toolbar_reconfigured = gtk_menu_tool_button_toolbar_reconfigured;
 
   /**
@@ -431,11 +431,9 @@ gtk_menu_tool_button_init (GtkMenuToolButton *button)
 }
 
 static void
-gtk_menu_tool_button_destroy (GtkObject *object)
+gtk_menu_tool_button_destroy (GtkWidget *widget)
 {
-  GtkMenuToolButton *button;
-
-  button = GTK_MENU_TOOL_BUTTON (object);
+  GtkMenuToolButton *button = GTK_MENU_TOOL_BUTTON (widget);
 
   if (button->priv->menu)
     {
@@ -452,7 +450,7 @@ gtk_menu_tool_button_destroy (GtkObject *object)
 					    button);
     }
 
-  GTK_OBJECT_CLASS (gtk_menu_tool_button_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_menu_tool_button_parent_class)->destroy (widget);
 }
 
 /**
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 09f8dde..1562759 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -263,8 +263,7 @@ static void     gtk_notebook_query_tab_label_packing (GtkNotebook  *notebook,
                                                       gboolean     *fill,
                                                       GtkPackType  *pack_type);
 
-/*** GtkObject Methods ***/
-static void gtk_notebook_destroy             (GtkObject        *object);
+/*** GObject Methods ***/
 static void gtk_notebook_set_property	     (GObject         *object,
 					      guint            prop_id,
 					      const GValue    *value,
@@ -275,6 +274,7 @@ static void gtk_notebook_get_property	     (GObject         *object,
 					      GParamSpec      *pspec);
 
 /*** GtkWidget Methods ***/
+static void gtk_notebook_destroy             (GtkWidget        *widget);
 static void gtk_notebook_map                 (GtkWidget        *widget);
 static void gtk_notebook_unmap               (GtkWidget        *widget);
 static void gtk_notebook_realize             (GtkWidget        *widget);
@@ -545,15 +545,14 @@ static void
 gtk_notebook_class_init (GtkNotebookClass *class)
 {
   GObjectClass   *gobject_class = G_OBJECT_CLASS (class);
-  GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
   GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
   GtkBindingSet *binding_set;
   
   gobject_class->set_property = gtk_notebook_set_property;
   gobject_class->get_property = gtk_notebook_get_property;
-  object_class->destroy = gtk_notebook_destroy;
 
+  widget_class->destroy = gtk_notebook_destroy;
   widget_class->map = gtk_notebook_map;
   widget_class->unmap = gtk_notebook_unmap;
   widget_class->realize = gtk_notebook_realize;
@@ -1464,37 +1463,12 @@ gtk_notebook_new (void)
   return g_object_new (GTK_TYPE_NOTEBOOK, NULL);
 }
 
-/* Private GtkObject Methods :
- * 
- * gtk_notebook_destroy
- * gtk_notebook_set_arg
- * gtk_notebook_get_arg
+/* Private GObject Methods :
+ *
+ * gtk_notebook_set_property
+ * gtk_notebook_get_property
  */
 static void
-gtk_notebook_destroy (GtkObject *object)
-{
-  GtkNotebook *notebook = GTK_NOTEBOOK (object);
-  GtkNotebookPrivate *priv = notebook->priv;
-
-  if (priv->menu)
-    gtk_notebook_popup_disable (notebook);
-
-  if (priv->source_targets)
-    {
-      gtk_target_list_unref (priv->source_targets);
-      priv->source_targets = NULL;
-    }
-
-  if (priv->switch_tab_timer)
-    {
-      g_source_remove (priv->switch_tab_timer);
-      priv->switch_tab_timer = 0;
-    }
-
-  GTK_OBJECT_CLASS (gtk_notebook_parent_class)->destroy (object);
-}
-
-static void
 gtk_notebook_set_property (GObject         *object,
 			   guint            prop_id,
 			   const GValue    *value,
@@ -1575,7 +1549,8 @@ gtk_notebook_get_property (GObject         *object,
 }
 
 /* Private GtkWidget Methods :
- * 
+ *
+ * gtk_notebook_destroy
  * gtk_notebook_map
  * gtk_notebook_unmap
  * gtk_notebook_realize
@@ -1600,6 +1575,30 @@ gtk_notebook_get_property (GObject         *object,
  * gtk_notebook_drag_data_get
  * gtk_notebook_drag_data_received
  */
+static void
+gtk_notebook_destroy (GtkWidget *widget)
+{
+  GtkNotebook *notebook = GTK_NOTEBOOK (widget);
+  GtkNotebookPrivate *priv = notebook->priv;
+
+  if (priv->menu)
+    gtk_notebook_popup_disable (notebook);
+
+  if (priv->source_targets)
+    {
+      gtk_target_list_unref (priv->source_targets);
+      priv->source_targets = NULL;
+    }
+
+  if (priv->switch_tab_timer)
+    {
+      g_source_remove (priv->switch_tab_timer);
+      priv->switch_tab_timer = 0;
+    }
+
+  GTK_WIDGET_CLASS (gtk_notebook_parent_class)->destroy (widget);
+}
+
 static gboolean
 gtk_notebook_get_event_window_position (GtkNotebook  *notebook,
 					GdkRectangle *rectangle)
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index ad03d77..1b1470d 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -207,12 +207,10 @@ static void
 gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
 {
   GObjectClass *gobject_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
   GtkContainerClass *container_class;
 
   gobject_class = (GObjectClass *) path_bar_class;
-  object_class = (GtkObjectClass *) path_bar_class;
   widget_class = (GtkWidgetClass *) path_bar_class;
   container_class = (GtkContainerClass *) path_bar_class;
 
@@ -239,7 +237,7 @@ gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
 
   path_bar_signals [PATH_CLICKED] =
     g_signal_new (I_("path-clicked"),
-		  G_OBJECT_CLASS_TYPE (object_class),
+		  G_OBJECT_CLASS_TYPE (gobject_class),
 		  G_SIGNAL_RUN_FIRST,
 		  G_STRUCT_OFFSET (GtkPathBarClass, path_clicked),
 		  NULL, NULL,
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c
index bd11ef7..0cc7b43 100644
--- a/gtk/gtkradiobutton.c
+++ b/gtk/gtkradiobutton.c
@@ -114,7 +114,7 @@ enum {
 };
 
 
-static void     gtk_radio_button_destroy        (GtkObject           *object);
+static void     gtk_radio_button_destroy        (GtkWidget           *widget);
 static gboolean gtk_radio_button_focus          (GtkWidget           *widget,
 						 GtkDirectionType     direction);
 static void     gtk_radio_button_clicked        (GtkButton           *button);
@@ -137,13 +137,11 @@ static void
 gtk_radio_button_class_init (GtkRadioButtonClass *class)
 {
   GObjectClass *gobject_class;
-  GtkObjectClass *object_class;
   GtkButtonClass *button_class;
   GtkCheckButtonClass *check_button_class;
   GtkWidgetClass *widget_class;
 
   gobject_class = G_OBJECT_CLASS (class);
-  object_class = (GtkObjectClass*) class;
   widget_class = (GtkWidgetClass*) class;
   button_class = (GtkButtonClass*) class;
   check_button_class = (GtkCheckButtonClass*) class;
@@ -163,8 +161,7 @@ gtk_radio_button_class_init (GtkRadioButtonClass *class)
 							P_("The radio button whose group this widget belongs to."),
 							GTK_TYPE_RADIO_BUTTON,
 							GTK_PARAM_WRITABLE));
-  object_class->destroy = gtk_radio_button_destroy;
-
+  widget_class->destroy = gtk_radio_button_destroy;
   widget_class->focus = gtk_radio_button_focus;
 
   button_class->clicked = gtk_radio_button_clicked;
@@ -187,7 +184,7 @@ gtk_radio_button_class_init (GtkRadioButtonClass *class)
    * Since: 2.4
    */
   group_changed_signal = g_signal_new (I_("group-changed"),
-				       G_OBJECT_CLASS_TYPE (object_class),
+				       G_OBJECT_CLASS_TYPE (gobject_class),
 				       G_SIGNAL_RUN_FIRST,
 				       G_STRUCT_OFFSET (GtkRadioButtonClass, group_changed),
 				       NULL, NULL,
@@ -558,10 +555,10 @@ gtk_radio_button_get_group (GtkRadioButton *radio_button)
 
 
 static void
-gtk_radio_button_destroy (GtkObject *object)
+gtk_radio_button_destroy (GtkWidget *widget)
 {
   GtkWidget *old_group_singleton = NULL;
-  GtkRadioButton *radio_button = GTK_RADIO_BUTTON (object);
+  GtkRadioButton *radio_button = GTK_RADIO_BUTTON (widget);
   GtkRadioButtonPrivate *priv = radio_button->priv;
   GtkRadioButton *tmp_button;
   GSList *tmp_list;
@@ -591,7 +588,7 @@ gtk_radio_button_destroy (GtkObject *object)
   if (was_in_group)
     g_signal_emit (radio_button, group_changed_signal, 0);
 
-  GTK_OBJECT_CLASS (gtk_radio_button_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_radio_button_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtkradiomenuitem.c b/gtk/gtkradiomenuitem.c
index 8fdd12b..e89ad23 100644
--- a/gtk/gtkradiomenuitem.c
+++ b/gtk/gtkradiomenuitem.c
@@ -44,7 +44,7 @@ enum {
 };
 
 
-static void gtk_radio_menu_item_destroy        (GtkObject             *object);
+static void gtk_radio_menu_item_destroy        (GtkWidget             *widget);
 static void gtk_radio_menu_item_activate       (GtkMenuItem           *menu_item);
 static void gtk_radio_menu_item_set_property   (GObject               *object,
 						guint                  prop_id,
@@ -337,16 +337,20 @@ static void
 gtk_radio_menu_item_class_init (GtkRadioMenuItemClass *klass)
 {
   GObjectClass *gobject_class;  
-  GtkObjectClass *object_class;
+  GtkWidgetClass *widget_class;
   GtkMenuItemClass *menu_item_class;
 
   gobject_class = G_OBJECT_CLASS (klass);
-  object_class = GTK_OBJECT_CLASS (klass);
+  widget_class = GTK_WIDGET_CLASS (klass);
   menu_item_class = GTK_MENU_ITEM_CLASS (klass);
 
   gobject_class->set_property = gtk_radio_menu_item_set_property;
   gobject_class->get_property = gtk_radio_menu_item_get_property;
 
+  widget_class->destroy = gtk_radio_menu_item_destroy;
+
+  menu_item_class->activate = gtk_radio_menu_item_activate;
+
   /**
    * GtkRadioMenuItem:group:
    * 
@@ -362,10 +366,6 @@ gtk_radio_menu_item_class_init (GtkRadioMenuItemClass *klass)
 							GTK_TYPE_RADIO_MENU_ITEM,
 							GTK_PARAM_WRITABLE));
 
-  object_class->destroy = gtk_radio_menu_item_destroy;
-
-  menu_item_class->activate = gtk_radio_menu_item_activate;
-
   /**
    * GtkStyle::group-changed:
    * @style: the object which received the signal
@@ -380,7 +380,7 @@ gtk_radio_menu_item_class_init (GtkRadioMenuItemClass *klass)
    * Since: 2.4
    */
   group_changed_signal = g_signal_new (I_("group-changed"),
-				       G_OBJECT_CLASS_TYPE (object_class),
+				       G_OBJECT_CLASS_TYPE (gobject_class),
 				       G_SIGNAL_RUN_FIRST,
 				       G_STRUCT_OFFSET (GtkRadioMenuItemClass, group_changed),
 				       NULL, NULL,
@@ -405,9 +405,9 @@ gtk_radio_menu_item_init (GtkRadioMenuItem *radio_menu_item)
 }
 
 static void
-gtk_radio_menu_item_destroy (GtkObject *object)
+gtk_radio_menu_item_destroy (GtkWidget *widget)
 {
-  GtkRadioMenuItem *radio_menu_item = GTK_RADIO_MENU_ITEM (object);
+  GtkRadioMenuItem *radio_menu_item = GTK_RADIO_MENU_ITEM (widget);
   GtkRadioMenuItemPrivate *priv = radio_menu_item->priv;
   GtkWidget *old_group_singleton = NULL;
   GtkRadioMenuItem *tmp_menu_item;
@@ -438,7 +438,7 @@ gtk_radio_menu_item_destroy (GtkObject *object)
   if (was_in_group)
     g_signal_emit (radio_menu_item, group_changed_signal, 0);
 
-  GTK_OBJECT_CLASS (gtk_radio_menu_item_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_radio_menu_item_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 28e5e57..d5c72af 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -180,7 +180,7 @@ static void gtk_range_get_property   (GObject          *object,
                                       guint             prop_id,
                                       GValue           *value,
                                       GParamSpec       *pspec);
-static void gtk_range_destroy        (GtkObject        *object);
+static void gtk_range_destroy        (GtkWidget        *widget);
 static void gtk_range_size_request   (GtkWidget        *widget,
                                       GtkRequisition   *requisition);
 static void gtk_range_size_allocate  (GtkWidget        *widget,
@@ -279,18 +279,15 @@ static void
 gtk_range_class_init (GtkRangeClass *class)
 {
   GObjectClass   *gobject_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
 
   gobject_class = G_OBJECT_CLASS (class);
-  object_class = (GtkObjectClass*) class;
   widget_class = (GtkWidgetClass*) class;
 
   gobject_class->set_property = gtk_range_set_property;
   gobject_class->get_property = gtk_range_get_property;
 
-  object_class->destroy = gtk_range_destroy;
-
+  widget_class->destroy = gtk_range_destroy;
   widget_class->size_request = gtk_range_size_request;
   widget_class->size_allocate = gtk_range_size_allocate;
   widget_class->realize = gtk_range_realize;
@@ -1510,9 +1507,9 @@ should_invert (GtkRange *range)
 }
 
 static void
-gtk_range_destroy (GtkObject *object)
+gtk_range_destroy (GtkWidget *widget)
 {
-  GtkRange *range = GTK_RANGE (object);
+  GtkRange *range = GTK_RANGE (widget);
   GtkRangePrivate *priv = range->priv;
 
   gtk_range_remove_step_timer (range);
@@ -1543,7 +1540,7 @@ gtk_range_destroy (GtkObject *object)
       priv->n_marks = 0;
     }
 
-  GTK_OBJECT_CLASS (gtk_range_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_range_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 33a2e0d..28a5de3 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -110,7 +110,6 @@ enum
   LAST_SIGNAL
 };
 
-static void     gtk_scrolled_window_destroy            (GtkObject         *object);
 static void     gtk_scrolled_window_set_property       (GObject           *object,
                                                         guint              prop_id,
                                                         const GValue      *value,
@@ -120,6 +119,7 @@ static void     gtk_scrolled_window_get_property       (GObject           *objec
                                                         GValue            *value,
                                                         GParamSpec        *pspec);
 
+static void     gtk_scrolled_window_destroy            (GtkWidget         *widget);
 static void     gtk_scrolled_window_screen_changed     (GtkWidget         *widget,
                                                         GdkScreen         *previous_screen);
 static gboolean gtk_scrolled_window_expose             (GtkWidget         *widget,
@@ -210,20 +210,17 @@ static void
 gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
   GtkContainerClass *container_class;
   GtkBindingSet *binding_set;
 
-  object_class = (GtkObjectClass*) class;
   widget_class = (GtkWidgetClass*) class;
   container_class = (GtkContainerClass*) class;
 
   gobject_class->set_property = gtk_scrolled_window_set_property;
   gobject_class->get_property = gtk_scrolled_window_get_property;
 
-  object_class->destroy = gtk_scrolled_window_destroy;
-
+  widget_class->destroy = gtk_scrolled_window_destroy;
   widget_class->screen_changed = gtk_scrolled_window_screen_changed;
   widget_class->expose_event = gtk_scrolled_window_expose;
   widget_class->size_allocate = gtk_scrolled_window_size_allocate;
@@ -345,7 +342,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
 
   signals[SCROLL_CHILD] =
     g_signal_new (I_("scroll-child"),
-                  G_TYPE_FROM_CLASS (object_class),
+                  G_TYPE_FROM_CLASS (gobject_class),
                   G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                   G_STRUCT_OFFSET (GtkScrolledWindowClass, scroll_child),
                   NULL, NULL,
@@ -355,7 +352,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
 		  G_TYPE_BOOLEAN);
   signals[MOVE_FOCUS_OUT] =
     g_signal_new (I_("move-focus-out"),
-                  G_TYPE_FROM_CLASS (object_class),
+                  G_TYPE_FROM_CLASS (gobject_class),
                   G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                   G_STRUCT_OFFSET (GtkScrolledWindowClass, move_focus_out),
                   NULL, NULL,
@@ -911,9 +908,9 @@ gtk_scrolled_window_get_shadow_type (GtkScrolledWindow *scrolled_window)
 }
 
 static void
-gtk_scrolled_window_destroy (GtkObject *object)
+gtk_scrolled_window_destroy (GtkWidget *widget)
 {
-  GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (object);
+  GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (widget);
   GtkScrolledWindowPrivate *priv = scrolled_window->priv;
 
   if (priv->hscrollbar)
@@ -937,7 +934,7 @@ gtk_scrolled_window_destroy (GtkObject *object)
       priv->vscrollbar = NULL;
     }
 
-  GTK_OBJECT_CLASS (gtk_scrolled_window_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_scrolled_window_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index 7924067..93b8d2f 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -116,10 +116,10 @@ static void     gtk_statusbar_buildable_interface_init    (GtkBuildableIface *if
 static GObject *gtk_statusbar_buildable_get_internal_child (GtkBuildable *buildable,
                                                             GtkBuilder   *builder,
                                                             const gchar  *childname);
-static void     gtk_statusbar_destroy           (GtkObject         *object);
 static void     gtk_statusbar_update            (GtkStatusbar      *statusbar,
 						 guint              context_id,
 						 const gchar       *text);
+static void     gtk_statusbar_destroy           (GtkWidget         *widget);
 static void     gtk_statusbar_size_allocate     (GtkWidget         *widget,
 						 GtkAllocation     *allocation);
 static void     gtk_statusbar_realize           (GtkWidget         *widget);
@@ -163,18 +163,15 @@ static void
 gtk_statusbar_class_init (GtkStatusbarClass *class)
 {
   GObjectClass *gobject_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
 
   gobject_class = (GObjectClass *) class;
-  object_class = (GtkObjectClass *) class;
   widget_class = (GtkWidgetClass *) class;
 
   gobject_class->set_property = gtk_statusbar_set_property;
   gobject_class->get_property = gtk_statusbar_get_property;
 
-  object_class->destroy = gtk_statusbar_destroy;
-
+  widget_class->destroy = gtk_statusbar_destroy;
   widget_class->realize = gtk_statusbar_realize;
   widget_class->unrealize = gtk_statusbar_unrealize;
   widget_class->map = gtk_statusbar_map;
@@ -691,9 +688,9 @@ gtk_statusbar_get_message_area (GtkStatusbar *statusbar)
 }
 
 static void
-gtk_statusbar_destroy (GtkObject *object)
+gtk_statusbar_destroy (GtkWidget *widget)
 {
-  GtkStatusbar *statusbar = GTK_STATUSBAR (object);
+  GtkStatusbar *statusbar = GTK_STATUSBAR (widget);
   GtkStatusbarPrivate *priv = statusbar->priv;
   GSList *list;
 
@@ -713,7 +710,7 @@ gtk_statusbar_destroy (GtkObject *object)
   g_slist_free (priv->keys);
   priv->keys = NULL;
 
-  GTK_OBJECT_CLASS (gtk_statusbar_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_statusbar_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 18d468e..bec1d31 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -261,7 +261,6 @@ enum
   PROP_IM_MODULE
 };
 
-static void gtk_text_view_destroy              (GtkObject        *object);
 static void gtk_text_view_finalize             (GObject          *object);
 static void gtk_text_view_set_property         (GObject         *object,
 						guint            prop_id,
@@ -271,6 +270,7 @@ static void gtk_text_view_get_property         (GObject         *object,
 						guint            prop_id,
 						GValue          *value,
 						GParamSpec      *pspec);
+static void gtk_text_view_destroy              (GtkWidget        *widget);
 static void gtk_text_view_size_request         (GtkWidget        *widget,
                                                 GtkRequisition   *requisition);
 static void gtk_text_view_size_allocate        (GtkWidget        *widget,
@@ -563,7 +563,6 @@ static void
 gtk_text_view_class_init (GtkTextViewClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-  GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
   GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
   GtkBindingSet *binding_set;
@@ -572,10 +571,9 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
    */
   gobject_class->set_property = gtk_text_view_set_property;
   gobject_class->get_property = gtk_text_view_get_property;
-
-  object_class->destroy = gtk_text_view_destroy;
   gobject_class->finalize = gtk_text_view_finalize;
 
+  widget_class->destroy = gtk_text_view_destroy;
   widget_class->realize = gtk_text_view_realize;
   widget_class->unrealize = gtk_text_view_unrealize;
   widget_class->style_set = gtk_text_view_style_set;
@@ -1090,7 +1088,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
    */
   signals[SELECT_ALL] =
     g_signal_new_class_handler (I_("select-all"),
-                                G_OBJECT_CLASS_TYPE (object_class),
+                                G_OBJECT_CLASS_TYPE (gobject_class),
                                 G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                                 G_CALLBACK (gtk_text_view_select_all),
                                 NULL, NULL,
@@ -1109,7 +1107,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
    */ 
   signals[TOGGLE_CURSOR_VISIBLE] =
     g_signal_new_class_handler (I_("toggle-cursor-visible"),
-                                G_OBJECT_CLASS_TYPE (object_class),
+                                G_OBJECT_CLASS_TYPE (gobject_class),
                                 G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                                 G_CALLBACK (gtk_text_view_toggle_cursor_visible),
                                 NULL, NULL,
@@ -1132,7 +1130,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
    */
   signals[PREEDIT_CHANGED] =
     g_signal_new_class_handler (I_("preedit-changed"),
-                                G_OBJECT_CLASS_TYPE (object_class),
+                                G_OBJECT_CLASS_TYPE (gobject_class),
                                 G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                                 NULL,
                                 NULL, NULL,
@@ -3009,12 +3007,12 @@ gtk_text_view_remove_validate_idles (GtkTextView *text_view)
 }
 
 static void
-gtk_text_view_destroy (GtkObject *object)
+gtk_text_view_destroy (GtkWidget *widget)
 {
   GtkTextView *text_view;
   GtkTextViewPrivate *priv;
 
-  text_view = GTK_TEXT_VIEW (object);
+  text_view = GTK_TEXT_VIEW (widget);
   priv = text_view->priv;
 
   gtk_text_view_remove_validate_idles (text_view);
@@ -3033,7 +3031,7 @@ gtk_text_view_destroy (GtkObject *object)
       priv->im_spot_idle = 0;
     }
 
-  GTK_OBJECT_CLASS (gtk_text_view_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_text_view_parent_class)->destroy (widget);
 }
 
 static void
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 0be63a7..d1a533c 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -158,10 +158,8 @@ static void     gtk_tree_view_get_property         (GObject         *object,
 						    GValue          *value,
 						    GParamSpec      *pspec);
 
-/* gtkobject signals */
-static void     gtk_tree_view_destroy              (GtkObject        *object);
-
 /* gtkwidget signals */
+static void     gtk_tree_view_destroy              (GtkWidget        *widget);
 static void     gtk_tree_view_realize              (GtkWidget        *widget);
 static void     gtk_tree_view_unrealize            (GtkWidget        *widget);
 static void     gtk_tree_view_map                  (GtkWidget        *widget);
@@ -495,7 +493,6 @@ static void
 gtk_tree_view_class_init (GtkTreeViewClass *class)
 {
   GObjectClass *o_class;
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
   GtkContainerClass *container_class;
   GtkBindingSet *binding_set;
@@ -503,7 +500,6 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
   binding_set = gtk_binding_set_by_class (class);
 
   o_class = (GObjectClass *) class;
-  object_class = (GtkObjectClass *) class;
   widget_class = (GtkWidgetClass *) class;
   container_class = (GtkContainerClass *) class;
 
@@ -512,10 +508,8 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
   o_class->get_property = gtk_tree_view_get_property;
   o_class->finalize = gtk_tree_view_finalize;
 
-  /* GtkObject signals */
-  object_class->destroy = gtk_tree_view_destroy;
-
   /* GtkWidget signals */
+  widget_class->destroy = gtk_tree_view_destroy;
   widget_class->map = gtk_tree_view_map;
   widget_class->realize = gtk_tree_view_realize;
   widget_class->unrealize = gtk_tree_view_unrealize;
@@ -1021,7 +1015,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
 
   tree_view_signals[MOVE_CURSOR] =
     g_signal_new (I_("move-cursor"),
-		  G_TYPE_FROM_CLASS (object_class),
+		  G_TYPE_FROM_CLASS (o_class),
 		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkTreeViewClass, move_cursor),
 		  NULL, NULL,
@@ -1032,7 +1026,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
 
   tree_view_signals[SELECT_ALL] =
     g_signal_new (I_("select-all"),
-		  G_TYPE_FROM_CLASS (object_class),
+		  G_TYPE_FROM_CLASS (o_class),
 		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkTreeViewClass, select_all),
 		  NULL, NULL,
@@ -1041,7 +1035,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
 
   tree_view_signals[UNSELECT_ALL] =
     g_signal_new (I_("unselect-all"),
-		  G_TYPE_FROM_CLASS (object_class),
+		  G_TYPE_FROM_CLASS (o_class),
 		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkTreeViewClass, unselect_all),
 		  NULL, NULL,
@@ -1050,7 +1044,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
 
   tree_view_signals[SELECT_CURSOR_ROW] =
     g_signal_new (I_("select-cursor-row"),
-		  G_TYPE_FROM_CLASS (object_class),
+		  G_TYPE_FROM_CLASS (o_class),
 		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkTreeViewClass, select_cursor_row),
 		  NULL, NULL,
@@ -1060,7 +1054,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
 
   tree_view_signals[TOGGLE_CURSOR_ROW] =
     g_signal_new (I_("toggle-cursor-row"),
-		  G_TYPE_FROM_CLASS (object_class),
+		  G_TYPE_FROM_CLASS (o_class),
 		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkTreeViewClass, toggle_cursor_row),
 		  NULL, NULL,
@@ -1069,7 +1063,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
 
   tree_view_signals[EXPAND_COLLAPSE_CURSOR_ROW] =
     g_signal_new (I_("expand-collapse-cursor-row"),
-		  G_TYPE_FROM_CLASS (object_class),
+		  G_TYPE_FROM_CLASS (o_class),
 		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkTreeViewClass, expand_collapse_cursor_row),
 		  NULL, NULL,
@@ -1081,7 +1075,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
 
   tree_view_signals[SELECT_CURSOR_PARENT] =
     g_signal_new (I_("select-cursor-parent"),
-		  G_TYPE_FROM_CLASS (object_class),
+		  G_TYPE_FROM_CLASS (o_class),
 		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkTreeViewClass, select_cursor_parent),
 		  NULL, NULL,
@@ -1090,7 +1084,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
 
   tree_view_signals[START_INTERACTIVE_SEARCH] =
     g_signal_new (I_("start-interactive-search"),
-		  G_TYPE_FROM_CLASS (object_class),
+		  G_TYPE_FROM_CLASS (o_class),
 		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkTreeViewClass, start_interactive_search),
 		  NULL, NULL,
@@ -1568,7 +1562,7 @@ gtk_tree_view_buildable_get_internal_child (GtkBuildable      *buildable,
 						       childname);
 }
 
-/* GtkObject Methods
+/* GtkWidget Methods
  */
 
 static void
@@ -1586,9 +1580,9 @@ gtk_tree_view_free_rbtree (GtkTreeView *tree_view)
 }
 
 static void
-gtk_tree_view_destroy (GtkObject *object)
+gtk_tree_view_destroy (GtkWidget *widget)
 {
-  GtkTreeView *tree_view = GTK_TREE_VIEW (object);
+  GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
   GList *list;
 
   gtk_tree_view_stop_editing (tree_view, TRUE);
@@ -1702,14 +1696,9 @@ gtk_tree_view_destroy (GtkObject *object)
       tree_view->priv->vadjustment = NULL;
     }
 
-  GTK_OBJECT_CLASS (gtk_tree_view_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_tree_view_parent_class)->destroy (widget);
 }
 
-
-
-/* GtkWidget Methods
- */
-
 /* GtkWidget::map helper */
 static void
 gtk_tree_view_map_buttons (GtkTreeView *tree_view)
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 1244240..449af88 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -70,7 +70,6 @@ enum {
 
 
 static void gtk_viewport_finalize                 (GObject          *object);
-static void gtk_viewport_destroy                  (GtkObject        *object);
 static void gtk_viewport_set_property             (GObject         *object,
 						   guint            prop_id,
 						   const GValue    *value,
@@ -82,6 +81,7 @@ static void gtk_viewport_get_property             (GObject         *object,
 static void gtk_viewport_set_scroll_adjustments	  (GtkViewport	    *viewport,
 						   GtkAdjustment    *hadjustment,
 						   GtkAdjustment    *vadjustment);
+static void gtk_viewport_destroy                  (GtkWidget        *widget);
 static void gtk_viewport_realize                  (GtkWidget        *widget);
 static void gtk_viewport_unrealize                (GtkWidget        *widget);
 static void gtk_viewport_paint                    (GtkWidget        *widget,
@@ -113,12 +113,10 @@ G_DEFINE_TYPE_WITH_CODE (GtkViewport, gtk_viewport, GTK_TYPE_BIN,
 static void
 gtk_viewport_class_init (GtkViewportClass *class)
 {
-  GtkObjectClass *object_class;
   GObjectClass   *gobject_class;
   GtkWidgetClass *widget_class;
   GtkContainerClass *container_class;
 
-  object_class = (GtkObjectClass*) class;
   gobject_class = G_OBJECT_CLASS (class);
   widget_class = (GtkWidgetClass*) class;
   container_class = (GtkContainerClass*) class;
@@ -126,8 +124,8 @@ gtk_viewport_class_init (GtkViewportClass *class)
   gobject_class->finalize = gtk_viewport_finalize;
   gobject_class->set_property = gtk_viewport_set_property;
   gobject_class->get_property = gtk_viewport_get_property;
-  object_class->destroy = gtk_viewport_destroy;
-  
+
+  widget_class->destroy = gtk_viewport_destroy;
   widget_class->realize = gtk_viewport_realize;
   widget_class->unrealize = gtk_viewport_unrealize;
   widget_class->expose_event = gtk_viewport_expose;
@@ -316,14 +314,14 @@ gtk_viewport_finalize (GObject *object)
 }
 
 static void
-gtk_viewport_destroy (GtkObject *object)
+gtk_viewport_destroy (GtkWidget *widget)
 {
-  GtkViewport *viewport = GTK_VIEWPORT (object);
+  GtkViewport *viewport = GTK_VIEWPORT (widget);
 
   viewport_disconnect_adjustment (viewport, GTK_ORIENTATION_HORIZONTAL);
   viewport_disconnect_adjustment (viewport, GTK_ORIENTATION_VERTICAL);
 
-  GTK_OBJECT_CLASS (gtk_viewport_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_viewport_parent_class)->destroy (widget);
 }
 
 /**
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index b29e2f5..4b7157a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -149,6 +149,8 @@ struct _GtkWidgetPrivate
   /* unused bits in our 32-bit block */
   guint reserved : 10;
 
+  guint in_destruction : 1;
+
   /* The widget's name. If the widget does not have a name
    *  (the name is NULL), then its name (as returned by
    *  "gtk_widget_get_name") is its class's name.
@@ -183,6 +185,7 @@ struct _GtkWidgetPrivate
 };
 
 enum {
+  DESTROY,
   SHOW,
   HIDE,
   MAP,
@@ -507,7 +510,7 @@ gtk_widget_get_type (void)
 	NULL /* interface data */
       };
 
-      widget_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkWidget",
+      widget_type = g_type_register_static (G_TYPE_INITIALLY_UNOWNED, "GtkWidget",
                                            &widget_info, G_TYPE_FLAG_ABSTRACT);
 
       g_type_add_interface_static (widget_type, ATK_TYPE_IMPLEMENTOR,
@@ -1004,6 +1007,23 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                                                      0,
                                                      GTK_PARAM_READWRITE));
 
+   /**
+    * GtkWidget::destroy:
+    * @object: the object which received the signal
+    *
+    * Signals that all holders of a reference to the widget should release
+    * the reference that they hold. May result in finalization of the widget
+    * if all references are released.
+    */
+  widget_signals[DESTROY] =
+    g_signal_new (I_("destroy"),
+                  G_TYPE_FROM_CLASS (gobject_class),
+                  G_SIGNAL_RUN_CLEANUP | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
+                  G_STRUCT_OFFSET (GtkWidgetClass, destroy),
+                  NULL, NULL,
+                  _gtk_marshal_VOID__VOID,
+                  G_TYPE_NONE, 0);
+
   /**
    * GtkWidget::show:
    * @widget: the object which received the signal.
@@ -3400,8 +3420,9 @@ gtk_widget_unparent (GtkWidget *widget)
  * gtk_widget_destroy:
  * @widget: a #GtkWidget
  *
- * Destroys a widget. Equivalent to gtk_object_destroy(), except that
- * you don't have to cast the widget to #GtkObject. When a widget is
+ * Destroys a widget.
+ *
+ * When a widget is
  * destroyed, it will break any references it holds to other objects.
  * If the widget is inside a container, the widget will be removed
  * from the container. If the widget is a toplevel (derived from
@@ -3420,7 +3441,8 @@ gtk_widget_destroy (GtkWidget *widget)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  gtk_object_destroy ((GtkObject*) widget);
+  if (!widget->priv->in_destruction)
+    g_object_run_dispose (G_OBJECT (widget));
 }
 
 /**
@@ -9237,7 +9259,14 @@ gtk_widget_dispose (GObject *object)
   GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
   if (gtk_widget_get_realized (widget))
     gtk_widget_unrealize (widget);
-  
+
+  if (!priv->in_destruction)
+    {
+      priv->in_destruction = TRUE;
+      g_signal_emit (object, widget_signals[DESTROY], 0);
+      priv->in_destruction = FALSE;
+    }
+
   G_OBJECT_CLASS (gtk_widget_parent_class)->dispose (object);
 }
 
@@ -9260,8 +9289,6 @@ gtk_widget_real_destroy (GtkObject *object)
   g_object_unref (priv->style);
   priv->style = gtk_widget_get_default_style ();
   g_object_ref (priv->style);
-
-  GTK_OBJECT_CLASS (gtk_widget_parent_class)->destroy (object);
 }
 
 static void
@@ -9287,6 +9314,12 @@ gtk_widget_finalize (GObject *object)
   if (accessible)
     g_object_unref (accessible);
 
+  if (g_object_is_floating (object))
+    g_warning ("A floating object was finalized. This means that someone\n"
+               "called g_object_unref() on an object that had only a floating\n"
+               "reference; the initial floating reference is not owned by anyone\n"
+               "and must be removed with g_object_ref_sink().");
+
   G_OBJECT_CLASS (gtk_widget_parent_class)->finalize (object);
 }
 
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 36cd35d..052453e 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -256,7 +256,7 @@ struct _GtkWidget
    *  allows a GtkWidget pointer to be cast to a
    *  GtkObject pointer.
    */
-  GtkObject object;
+  GInitiallyUnowned object;
 
   /* internally used private flags. */
   guint GSEAL (private_flags) : 16;
@@ -307,7 +307,7 @@ struct _GtkWidget
  */
 struct _GtkWidgetClass
 {
-  GtkObjectClass parent_class;
+  GInitiallyUnownedClass parent_class;
 
   /*< public >*/
   
@@ -323,6 +323,7 @@ struct _GtkWidgetClass
 					     GParamSpec **pspecs);
 
   /* basics */
+  void (* destroy)             (GtkWidget        *widget);
   void (* show)		       (GtkWidget        *widget);
   void (* show_all)            (GtkWidget        *widget);
   void (* hide)		       (GtkWidget        *widget);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 756266e..c1982cc 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -287,8 +287,8 @@ struct _GtkWindowGroupPrivate
 };
 
 static void gtk_window_dispose            (GObject           *object);
-static void gtk_window_destroy            (GtkObject         *object);
 static void gtk_window_finalize           (GObject           *object);
+static void gtk_window_destroy            (GtkWidget         *widget);
 static void gtk_window_show               (GtkWidget         *widget);
 static void gtk_window_hide               (GtkWidget         *widget);
 static void gtk_window_map                (GtkWidget         *widget);
@@ -517,12 +517,10 @@ static void
 gtk_window_class_init (GtkWindowClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-  GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
   GtkContainerClass *container_class;
   GtkBindingSet *binding_set;
-  
-  object_class = (GtkObjectClass*) klass;
+
   widget_class = (GtkWidgetClass*) klass;
   container_class = (GtkContainerClass*) klass;
   
@@ -537,9 +535,8 @@ gtk_window_class_init (GtkWindowClass *klass)
 
   gobject_class->set_property = gtk_window_set_property;
   gobject_class->get_property = gtk_window_get_property;
-  
-  object_class->destroy = gtk_window_destroy;
 
+  widget_class->destroy = gtk_window_destroy;
   widget_class->show = gtk_window_show;
   widget_class->hide = gtk_window_hide;
   widget_class->map = gtk_window_map;
@@ -4482,9 +4479,9 @@ gtk_window_reshow_with_initial_size (GtkWindow *window)
 }
 
 static void
-gtk_window_destroy (GtkObject *object)
+gtk_window_destroy (GtkWidget *widget)
 {
-  GtkWindow *window = GTK_WINDOW (object);
+  GtkWindow *window = GTK_WINDOW (widget);
   GtkWindowPrivate *priv = window->priv;
 
   toplevel_list = g_slist_remove (toplevel_list, window);
@@ -4506,7 +4503,7 @@ gtk_window_destroy (GtkObject *object)
 
    gtk_window_free_key_hash (window);
 
-   GTK_OBJECT_CLASS (gtk_window_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtk_window_parent_class)->destroy (widget);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]