]> git.sur5r.net Git - glabels/blob - src/builder-util.c
Imported Upstream version 3.0.0
[glabels] / src / builder-util.c
1 /*
2  *  builder-util.c
3  *  Copyright (C) 2001-2009  Jim Evins <evins@snaught.com>.
4  *
5  *  This file is part of gLabels.
6  *
7  *  gLabels is free software: you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation, either version 3 of the License, or
10  *  (at your option) any later version.
11  *
12  *  gLabels is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with gLabels.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #include <config.h>
22
23 #include "builder-util.h"
24
25
26 /****************************************************************************/
27 /* Get widgets from GtkBuilder "en masse."                                  */
28 /****************************************************************************/
29 void gl_builder_util_get_widgets (GtkBuilder *builder,
30                                   gchar      *first_name,
31                                   ...)
32 {
33         va_list     args;
34         gchar      *name;
35         GtkWidget **p_widget;
36
37         va_start (args, first_name);
38
39         for ( name = first_name; name; name = va_arg (args, gchar *) )
40         {
41                 p_widget = va_arg (args, GtkWidget **);
42
43                 *p_widget = GTK_WIDGET (gtk_builder_get_object (builder, name));
44
45                 if (!*p_widget)
46                 {
47                         g_critical ("Could not load widget \"%s\".\n\ngLabels may not be installed correctly!",
48                                     name);
49                         break;
50                 }
51         }
52
53         va_end (args);
54 }
55
56
57
58 /*
59  * Local Variables:       -- emacs
60  * mode: C                -- emacs
61  * c-basic-offset: 8      -- emacs
62  * tab-width: 8           -- emacs
63  * indent-tabs-mode: nil  -- emacs
64  * End:                   -- emacs
65  */