]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/gnome_helpers.h
Fixed compilation problems.
[lyx.git] / src / frontends / gnome / gnome_helpers.h
1 // -*- C++ -*-
2 /* This file is part of
3  * =================================================
4  * 
5  *          LyX, The Document Processor
6  *          Copyright 1995-2000 The LyX Team.
7  *
8  * ================================================= */
9
10 #ifndef GNOME_HELPERS_H
11 #define GNOME_HELPERS_H
12
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 #include "debug.h"
18 #include <glade/glade-xml.h>
19 #include <glib.h>
20
21 // Glade Helper Function.  
22 template<class T>
23 T* getWidgetPtr(GladeXML* xml, const char* name)
24 {   
25         T* result = static_cast<T*>(Gtk::wrap_auto((GtkObject*)glade_xml_get_widget(xml, name)));
26         if (result == NULL)
27         {
28                 lyxerr << "** ERROR **: unable to load widget: " << name << endl;
29                 g_assert(result != NULL);
30         }
31         return result;
32 }
33
34
35
36 #endif