[Glade-users] Problem with GtkBuilder

2009/10/7 Aidin Gharibnavaz <aidin at aidinhut.com>:

I have a problem with glade, and GtkBuilder. I create a UI with glade, and
it in my python application, using following codes:

?? builder = gtk.Builder();
?? builder.add_from_file("sample.glade")

It works nicely. But I can't add something to my containers using
'add_child()', or anything else. I do as following:

?? builder.get_object('vbox1').add_child(mywidget)

?It don't throw any error, but also don't add 'mywidget' into the box.
?Is it possible to do something like this?

Yes, it is possible. With boxes the methods pack_start and pack_end
are preferred. Remember you should show the widget after add it to the


If your widget is composed of multiple sub widgets, you should use:


?The reason is that I have a custom widget, and I want to add it to my UI
?using code. (I couldn't add it to Glade's catalog. Glade's Doc didn't help)

?Thanks in advanced.

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

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