gtk_label_set_text() won't be called until AFTER you call gtk_main_quit(). Once you enter the main GTK+ loop, the application is in a sort of "event driven" mode. That is, you're waiting for an action from the user at which point a callback function is called. A user clicks a button and it's your callback function for that button is called (thing OnClick in visual basic)
In fact, you may want to read this: VB Programmerâ€™s Intro to Linux Programming with GTK+
It sounds like you want to update your labels periodically, without user interaction. In that case, you may want to use a timeout function. If you read about the Main Event Loop in the GTK+ API
, you'll see a function called g_timeout_add(). With this you can specify a function to call every x milliseconds. In this function, you can update your label.
update_label (gpointer label)
return FALSE: /* stop calling this function */
main (int argc, char *argv)
GtkWidget *label, *window;
xml = glade_xml_new ("src/energy-management.glade", NULL, NULL);
label = glade_xml_get_widget (xml, "labelZone1Temperature");
window = glade_xml_get_widget (xml, "window1");
/* connect signal handlers */
gtk_label_set_text(GTK_LABEL(label), "Initial Value");
/* set timout for 5 seconds */
g_timeout_add(5000, (GSourceFunc)update_label, NULL);
Please note... I just wrote that code off the top of my head. It probably doesn't quite work but hopefully it gives you the basic idea.