Added SILC Thread Queue API
[crypto.git] / apps / silcer / src / silcer_gladehelper.hh
1 /*
2
3   silcer_gladehelper.hh 
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2001 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; version 2 of the License.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18 */
19
20 #ifndef SILCER_GLADEHELPER_HH
21 #define SILCER_GLADEHELPER_HH
22
23 #include <glade/glade-xml.h>
24 #include <gtk/gtkobject.h>
25 #include <gtk--/base.h>
26
27 template<class T> T *SilcerGetWidget(GladeXML* obj, const char *name)
28 {
29   T *widget = 
30     static_cast<T *>(Gtk::wrap_auto((GtkObject *)
31                                     glade_xml_get_widget(obj, name)));
32   if (!widget)
33     g_error("Could not find widget `%s'", name);
34   return widget;
35 }
36
37 #endif /* SILCER_GLADEHELPER_HH */