[Glade-users] Loading widgets from XML file using libglade

Thanks thats sorted it. But how do I update the contents of a container 
on the fly. For example Ive defined the following function which is 
called when the program starts and loads the widgets from Glade no problem:

void showPage1()
        //load page1 from Glade and set as content in rightpanevbox
        rightpanevbox= glade_xml_get_widget(page1xml,"mainvbox");

        pagedisplayed = "Page1";

If however I call this function later on a second time I get that same 
Gtk-CRITICAL **: gtk_scrolled_window_add_with_viewport: assertion 
`child->parent == NULL' failed

Im assuming this is because the scrolled window already has something in 
it which I first need to remove?

Lukasz Gromotowicz wrote:
As far as I can see, the Gtk-Critical fault says that you can not put 
the widget onto another parent because it already has a parent. The 
second parameter in the glade_xml_new() is for the root widget node. 
Try this:


and then

rightpanevbox= glade_xml_get_widget(page1xml,"mainvbox");

Hope it works,
good luck.

LUK (gromot)

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