1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * $Id: glade.c,v 1.6 2005/02/19 13:37:47 nedko Exp $
9 *****************************************************************************/
13 #include <glade/glade.h>
19 glade_signal_connect_func(
20 const gchar
*cb_name
, GObject
*obj
,
21 const gchar
*signal_name
, const gchar
*signal_data
,
22 GObject
*conn_obj
, gboolean conn_after
,
25 /** Module with all the symbols of the program */
26 static GModule
*mod_self
= NULL
;
27 gpointer handler_func
;
29 /* initialize gmodule */
32 mod_self
= g_module_open(NULL
, 0);
33 g_assert(mod_self
!= NULL
);
36 /* g_print("glade_signal_connect_func:" */
37 /* " cb_name = '%s', signal_name = '%s', " */
38 /* "signal_data = '%s', obj = 0x%08X, conn_after = %s\n", */
39 /* cb_name, signal_name, */
40 /* signal_data, (unsigned int)obj, conn_after?"true":"false"); */
42 if (g_module_symbol(mod_self
, cb_name
, &handler_func
))
49 g_signal_connect_object(
58 g_signal_connect_object(
68 /* no conn_obj; use standard connect */
75 g_signal_connect_after(
93 g_warning("callback function not found: %s", cb_name
);
98 construct_glade_widget(
101 gchar
* glade_filename
;
105 glade_filename
= path_get_data_filename("mediadatabase.glade");
106 if (glade_filename
== NULL
)
108 g_warning("Cannot find glade UI description file.");
112 /* load the interface */
113 xml
= glade_xml_new(glade_filename
, id
, NULL
);
115 g_free(glade_filename
);
117 widget
= glade_xml_get_widget(xml
, id
);
119 /* connect the signals in the interface */
120 glade_xml_signal_autoconnect_full(
122 (GladeXMLConnectFunc
)glade_signal_connect_func
,
129 get_glade_widget_child(
136 xml
= glade_get_widget_tree(root
);
138 widget
= glade_xml_get_widget(xml
, id
);
147 GtkCellRenderer
* cell
;
148 GtkListStore
* store
;
150 store
= gtk_list_store_new(1, G_TYPE_STRING
);
151 gtk_combo_box_set_model(GTK_COMBO_BOX(combo
), GTK_TREE_MODEL(store
));
152 g_object_unref(store
);
154 cell
= gtk_cell_renderer_text_new();
155 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo
), cell
, TRUE
);
157 gtk_cell_layout_set_attributes(
158 GTK_CELL_LAYOUT(combo
), cell
,
163 /*****************************************************************************
167 * !!! WARNING !!! Following lines are automatically updated by the CVS system.
170 * Revision 1.6 2005/02/19 13:37:47 nedko
171 * gtk_combo_box_new_text for glade
173 * Revision 1.5 2005/02/18 22:41:26 nedko
174 * Improve connect dump
176 * Revision 1.4 2005/02/18 22:18:07 nedko
177 * Cleanup things and make them better way.
179 * Revision 1.3 2005/02/18 21:38:28 nedko
180 * NOTSURE: Load more than one window.
182 * Revision 1.2 2005/02/18 02:14:22 nedko
183 * Set source file description
185 * Revision 1.1 2005/02/18 02:13:35 nedko
188 *****************************************************************************/