mixing widgets via glade and standard way ? (newbie)



Dear folks,

I'm wondering whether XML/glade based widget creation and 'standard' widget creation combine. All widgets are generated by libglade-2.0. Changing the text in an existing label works, adding a label to the table doesn't:

{
       GtkWidget *l, *tl;
if( !(tl=glade_xml_get_widget( pgcw.xml, "table_mancontrol_lamps" )) ) { fprintf(stderr,"%s: can't get lamp table widget\n", __func__ );
               return(-1);
       }
       l=gtk_label_new("foo");
       gtk_table_attach_defaults( GTK_TABLE(tl), l, 2,3,2,3 );
       return(0);
}

Are standard gtk calls failing since glade changes some internal callbacks when creating the table, or am I missing something obvious ? (I wouldn't think its some buffer issue, since the above routine gets called once via g_idle_add and the label doesn't appear after resizing/iconify). table size is 4x4 in the XML file.

Second question:

Entries to a notebook all use the same layout and different variable space. The layout for the first page is generated, amongst the rest of the GUI, using XML/libglade, the others are to be cloned at runtime (number of notebook pages is only kown at runtime). What's the "good" way to do this ? I realize one way is to use glade_xml_new with root and domain options and attached the tree at the notebook. Right ? Is there a general way to cut/paste a widget subtree to a different node within Gtk ?

many thanks for any light&insight
regards
Fred



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]