diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2013-07-05 00:09:12 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2013-07-09 09:30:02 +0100 |
commit | 76df3ba7d018b5d5d60c4409735b1e446d324f2e (patch) | |
tree | 6931e5e07fca03f794ace71067c01061a317a76b /demos | |
parent | 84186ef11be9cb8f46e1b762ae2b04d62b741065 (diff) | |
download | gtk+-76df3ba7d018b5d5d60c4409735b1e446d324f2e.tar.gz |
gtk-demo: Use the new macros for adding instance private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
Diffstat (limited to 'demos')
-rw-r--r-- | demos/gtk-demo/listbox.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/demos/gtk-demo/listbox.c b/demos/gtk-demo/listbox.c index 721518a1d0..12aa541fa9 100644 --- a/demos/gtk-demo/listbox.c +++ b/demos/gtk-demo/listbox.c @@ -145,7 +145,7 @@ gtk_message_new (const char *str) return msg; } -G_DEFINE_TYPE (GtkMessageRow, gtk_message_row, GTK_TYPE_LIST_BOX_ROW); +G_DEFINE_TYPE_WITH_PRIVATE (GtkMessageRow, gtk_message_row, GTK_TYPE_LIST_BOX_ROW); static void @@ -252,8 +252,6 @@ gtk_message_row_class_init (GtkMessageRowClass *klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - g_type_class_add_private (klass, sizeof (GtkMessageRowPrivate)); - gtk_widget_class_set_template_from_resource (widget_class, "/listbox/listbox.ui"); gtk_widget_class_bind_child(widget_class, GtkMessageRowPrivate, content_label); gtk_widget_class_bind_child(widget_class, GtkMessageRowPrivate, source_name); @@ -278,10 +276,7 @@ gtk_message_row_class_init (GtkMessageRowClass *klass) static void gtk_message_row_init (GtkMessageRow *row) { - GtkMessageRowPrivate *priv; - - row->priv = priv = - G_TYPE_INSTANCE_GET_PRIVATE (row, GTK_TYPE_MESSAGE_ROW, GtkMessageRowPrivate); + row->priv = gtk_message_row_get_instance_private (row); gtk_widget_init_template (GTK_WIDGET (row)); } |