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

On Wed, Feb 24, 2010 at 2:05 PM, Andrew Wood <ajwood at theiet.org> wrote:
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)
How would I do this using GtkBuilder? As far as I can see
gtk_builder_add_from_file doesnt support a similar argument.

Using gtk_builder_get_object (builder, "mainvbox")) ?doesnt stop parent
widgets being obtained as well.

The mainvbox is in a window in Glade because you have to put it in one,
but when I read the file into my program I already have a window for it
to go in, I only need the vbox.

Just doing

gtk_builder_add_from_file (builder, "./gladexml/general.xml", NULL);
? ? ? ?generalpage= GTK_WIDGET (gtk_builder_get_object (builder,



is giving the error:
?Gtk-CRITICAL **: gtk_scrolled_window_add_with_viewport: assertion
`child->parent == NULL' failed

Ok, I believe there is an api to cherry pick objects that you want
parsed (its in one of the newer versions of GTK+).

Or, you can just remove the window in Glade (i.e. Glade does
not require you to have a toplevel GtkWindow for GtkBuilder

You should be able to do it with "Remove Parent" from the context menu
for your vbox.


Glade-users maillist ?- ?Glade-users at lists.ximian.com

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