Update stash widget lookup code.

This commit is contained in:
Matthew Brush 2011-09-21 21:31:51 -07:00 committed by Matthew Brush
parent c39ad3e29d
commit 14e880dd96

View File

@ -525,26 +525,14 @@ static void handle_combo_box_entry(GtkWidget *widget, StashPref *entry,
}
/* FIXME */
/* taken from Glade 2.x generated support.c */
static GtkWidget*
lookup_widget(GtkWidget *widget, const gchar *widget_name)
{
GtkWidget *parent, *found_widget;
GtkWidget *found_widget;
for (;;)
{
if (GTK_IS_MENU (widget))
parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
else
parent = widget->parent;
if (!parent)
parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
if (parent == NULL)
break;
widget = parent;
}
found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget), widget_name);
found_widget = GTK_WIDGET(interface_get_object(widget_name));
if (!found_widget)
g_warning ("Widget not found: %s", widget_name);
return found_widget;