--- a/gntwidget.c Wed Apr 03 19:22:35 2019 -0400
+++ b/gntwidget.c Wed Apr 03 20:44:30 2019 -0400
@@ -47,17 +47,19 @@
-static GObjectClass *parent_class = NULL;
static guint signals[SIGS] = { 0 };
static void init_widget(GntWidget *widget);
+G_DEFINE_TYPE(GntWidget, gnt_widget, GNT_TYPE_BINDABLE) +/****************************************************************************** + * GObject Implementation + *****************************************************************************/ -gnt_widget_init(GTypeInstance *instance, gpointer class)
+gnt_widget_init(GntWidget *widget) - GntWidget *widget = GNT_WIDGET(instance);
widget->priv.name = NULL;
@@ -74,8 +76,7 @@
GntWidget *self = GNT_WIDGET(obj);
g_signal_emit(self, signals[SIG_DESTROY], 0);
- parent_class->dispose(obj);
+ G_OBJECT_CLASS(gnt_widget_parent_class)->dispose(obj); @@ -112,8 +113,6 @@
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
- parent_class = g_type_class_peek_parent(klass);
obj_class->dispose = gnt_widget_dispose;
klass->destroy = gnt_widget_destroy;
@@ -250,33 +249,6 @@
/******************************************************************************
*****************************************************************************/
-gnt_widget_get_type(void)
- static const GTypeInfo info = {
- sizeof(GntWidgetClass),
- NULL, /* base_finalize */
- (GClassInitFunc)gnt_widget_class_init,
- gnt_widget_init, /* instance_init */
- type = g_type_register_static(GNT_TYPE_BINDABLE,
- &info, G_TYPE_FLAG_ABSTRACT);
void gnt_widget_set_take_focus(GntWidget *widget, gboolean can)