[pygtk] Replacing a widget using libglade?
Bil Simser
emailme at bilsimser.com
Wed Jan 23 02:59:19 WST 2008
Hi guys,
I'm trying to figure out how to leverage libglade with my pygtk app. I have
a window that contains a vbox with menu at the top and status bar at the
bottom. I have a custom widget in code (inherited from gtk.DrawingArea) that
I want to slip in between the menu and status bar. I'm not sure how I can do
this without just ignoring the glade file and loading the widgets manually
into a new vbox. I tried just adding in a stock DrawingArea widget onto my
glade form and replacing it with something like this:
self.stockDrawingArea = self.widgets.get_widget("drawingAreaPlaceHolder")
self.stockDrawingArea = CustomDrawingArea()
but of course that just assigns the object twice.
I can do something like this in my code:
Vbox = gtk.Vbox()
Vbox.pack_start(widgets.get_widget("menuBar"))
Vbox.pack_start(CustomDrawingArea())
Vbox.pack_start(widgets.get_widget("statusBar"))
But that seems like I'm misusing glade.
Any suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20080122/75ef269d/attachment.htm
More information about the pygtk
mailing list