[pygtk] How to refill a container?
Alessandro Dentella
sandro at e-den.it
Sun Aug 31 23:47:31 WST 2008
On Sun, Aug 31, 2008 at 08:23:19AM -0700, nielinjie wrote:
> Hello list:
> I am trying to refill a container (a VBox in my case), saying that I
> want to remove all child from the container and then add some ones
> else. Here is my code.
>
> self.vbox.foreach(lambda widget:self.vbox.remove(widget))
> i=0
> for every in myList:
> frame=gtk.Frame()
> widget=gtk.Label()
> frame.add(widget)
> self.vbox.pack_start(frame)
>
> removing looks works, old children disappeared, but new ones does not
> appear... :-(
> Is there any method like 'redraw' needed to be call?
did you try to "show_all" self.vbox?
self.vbox.show_all()
and secondarily:
* is myList non empty?
* why do you need 'every' that you never use?
sandro
*:-)
More information about the pygtk
mailing list