[gtk+] gtk-demo: Use the new macros for adding instance private data
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtk-demo: Use the new macros for adding instance private data
- Date: Tue, 9 Jul 2013 08:43:35 +0000 (UTC)
commit 76df3ba7d018b5d5d60c4409735b1e446d324f2e
Author: Emmanuele Bassi <ebassi gnome org>
Date: Fri Jul 5 00:09:12 2013 +0100
gtk-demo: Use the new macros for adding instance private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
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 721518a..12aa541 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));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]