summaryrefslogtreecommitdiff
path: root/gtk2_ardour/gtk-custom-hruler.c
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2005-11-26 00:06:46 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2005-11-26 00:06:46 +0000
commitf69abbff90ac8b8426bb0c6e02a7f4d4a3fd5e6d (patch)
tree3f694b5bb3cdee16813e224eb183a2435605fe78 /gtk2_ardour/gtk-custom-hruler.c
parent026f506bc6912f1374d21ccccf42542f749a6cb7 (diff)
compiles and runs, but crashes ... duh
git-svn-id: svn://localhost/trunk/ardour2@113 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/gtk-custom-hruler.c')
-rw-r--r--gtk2_ardour/gtk-custom-hruler.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/gtk2_ardour/gtk-custom-hruler.c b/gtk2_ardour/gtk-custom-hruler.c
index 9c81ddf3b4..671d1b68b4 100644
--- a/gtk2_ardour/gtk-custom-hruler.c
+++ b/gtk2_ardour/gtk-custom-hruler.c
@@ -46,22 +46,28 @@ static void gtk_custom_hruler_draw_pos (GtkCustomRuler * ruler);
guint gtk_custom_hruler_get_type (void)
{
- static guint custom_hruler_type = 0;
-
- if (!custom_hruler_type) {
- static const GtkTypeInfo custom_hruler_info = {
- "GtkCustomHRuler",
- sizeof (GtkCustomHRuler),
- sizeof (GtkCustomHRulerClass),
- (GtkClassInitFunc) gtk_custom_hruler_class_init,
- (GtkObjectInitFunc) gtk_custom_hruler_init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
- custom_hruler_type = gtk_type_unique (gtk_custom_ruler_get_type (), &custom_hruler_info);
+ static GType hruler_type = 0;
+
+ if (!hruler_type)
+ {
+ static const GTypeInfo hruler_info =
+ {
+ sizeof (GtkCustomHRulerClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) gtk_custom_hruler_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (GtkCustomHRuler),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) gtk_custom_hruler_init,
+ };
+
+ hruler_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCustomHRuler",
+ &hruler_info, 0);
}
- return custom_hruler_type;
+
+ return hruler_type;
}
static void