re[pygtk] move item from gtk.Table

awalter1 alain.walter at thalesgroup.com
Wed Nov 21 01:40:51 WST 2007


Hello,

I' m using a gtk.Table within a scrolled window. The contents of the table
depends on the choice of the user. Then I need to replace the contents of
the table according to a new user's selection.
I know how to add element (method attach) to a table, but how to remove one
?
A solution should be to create a new gtk.Table, but the association to the
scrolledwindow (add_with_viewport) does not allow to be executed two times.

The consequences of the current code is that on the second user selection,
the new table contents overwrites the old one : labels are overlayed.

Here is a part of my code :
self.table = gtk.Table(1, 1, True)
# pack the table into the scrolled window
self.scrolled_window.add_with_viewport(self.table)
...
self.table.resize(len(l_label),1)					
for i in range(len(l_label)):
   # Create button.
   button = gtk.CheckButton(l_label[i])
   self.table.attach(button, 0, 1,i, i+1)

I suppose that the solution is very simple, but I can't see.
Thank you for any suggestion.


-- 
View this message in context: http://www.nabble.com/remove-item-from-gtk.Table-tf4844550.html#a13860436
Sent from the Gtk+ - Python mailing list archive at Nabble.com.



More information about the pygtk mailing list