[pygtk] reparent problem

John Stowers john.stowers.lists at gmail.com
Sun Jun 29 20:57:46 WST 2008


On Sun, 2008-06-29 at 12:25 +0200, Frédéric wrote:
> Hello,
> 
> To integrate my shootingArea widget (which inherits gtk.Drawingarea) in my 
> GTU (defined with glade), I follow theses steps:
> 
> 1) in glade, I create a dummy widget where I want to put my custom widget;

Why create a dummy widget at all? You could just pack the shooting
widget into a container, likely the container that your dummy widget
currently resides in.

John

> 
> 2) in my code, right after loading the glade file, I do:
> 
> dummyWidget = self.wTree.get_widget(dummyWidget)
> parent = dummyWidget.parent
> del dummyWidget
> self.shootingArea = ShootingArea()
> self.shootingArea.set_parent(parent)
> self.shootingArea.show()
> 
> But my widget does not work, and neither displayed (none of the 'realize' 
> or 'configure-event' or expose-event' callabck is called).
> 
> Any idea?
> 



More information about the pygtk mailing list