- Updated UFA:Plugin (mattn2)
[xonotic/netradiant.git] / contrib / brushexport / support.cpp
1 #include <gtk/gtk.h>\r
2 \r
3 #include "support.h"\r
4 \r
5 GtkWidget*\r
6 lookup_widget                          (GtkWidget       *widget,\r
7                                         const gchar     *widget_name)\r
8 {\r
9   GtkWidget *parent, *found_widget;\r
10 \r
11   for (;;)\r
12     {\r
13       if (GTK_IS_MENU (widget))\r
14         parent = gtk_menu_get_attach_widget (GTK_MENU (widget));\r
15       else\r
16         parent = widget->parent;\r
17       if (!parent)\r
18         parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");\r
19       if (parent == NULL)\r
20         break;\r
21       widget = parent;\r
22     }\r
23 \r
24   found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),\r
25                                                  widget_name);\r
26   if (!found_widget)\r
27     g_warning ("Widget not found: %s", widget_name);\r
28   return found_widget;\r
29 }\r
30 \r
31 \r