summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2008-03-09 15:38:36 -0400
committerSøren Sandmann <sandmann@redhat.com>2008-03-09 15:38:36 -0400
commit026076ce3fd74404472af51f31403f7f7ff93164 (patch)
tree444692d4f3733038c3ff0ab89d93f7dc5ac50208
parent0edb4abff46d5a8eb72607434c24627911935be6 (diff)
Make GET_WIDGET a function
-rw-r--r--window.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/window.c b/window.c
index 2246b20..96858bc 100644
--- a/window.c
+++ b/window.c
@@ -5,9 +5,6 @@
#define MIN_ZOOM -80
#define MAX_ZOOM 65
-#define GET_WIDGET(window,name) \
- ((void *)glade_xml_get_widget(window->xml, name))
-
struct Window
{
GladeXML * xml;
@@ -22,6 +19,17 @@ struct Window
App * app;
};
+static void *
+GET_WIDGET (Window *window, const char *name)
+{
+ void *result = glade_xml_get_widget (window->xml, name);
+
+ if (!result)
+ g_error ("Could not find widget %s\n", name);
+
+ return result;
+}
+
static double
get_scale (Window *window)
{