diff options
author | Tim Janik <timj@gtk.org> | 1999-01-10 19:05:36 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1999-01-10 19:05:36 +0000 |
commit | bcbe6f4885a7101a6b4168d1174882cacc3dcc0b (patch) | |
tree | fb5f03c142e17b21b3fe88220ccaabed980c9bcb /gtk/gtksignal.c | |
parent | a24e14ceb4583ed5e30183b0908b108fcdc57bb7 (diff) | |
download | gtk+-bcbe6f4885a7101a6b4168d1174882cacc3dcc0b.tar.gz |
if the lookup failed, try to initialize the object class and reattempt the
1999-01-10 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_lookup): if the lookup failed, try
to initialize the object class and reattempt the lookup, reported
by Paolo Molaro <lupus@lettere.unipd.it>.
Diffstat (limited to 'gtk/gtksignal.c')
-rw-r--r-- | gtk/gtksignal.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/gtk/gtksignal.c b/gtk/gtksignal.c index 198e3b9ea3..d3ce62d60c 100644 --- a/gtk/gtksignal.c +++ b/gtk/gtksignal.c @@ -402,27 +402,38 @@ gtk_signal_lookup (const gchar *name, GtkType object_type) { GtkSignalHash hash; - + GtkType lookup_type; + gpointer class = NULL; + g_return_val_if_fail (name != NULL, 0); g_return_val_if_fail (gtk_type_is_a (object_type, GTK_TYPE_OBJECT), 0); + relookup: + + lookup_type = object_type; hash.quark = g_quark_try_string (name); if (hash.quark) { - while (object_type) + while (lookup_type) { guint signal_id; - hash.object_type = object_type; + hash.object_type = lookup_type; signal_id = GPOINTER_TO_UINT (g_hash_table_lookup (gtk_signal_hash_table, &hash)); if (signal_id) return signal_id; - object_type = gtk_type_parent (object_type); + lookup_type = gtk_type_parent (lookup_type); } } - + + if (!class) + { + class = gtk_type_class (object_type); + goto relookup; + } + return 0; } |