Hey that worked !
thanks for your help with this, seems easy now, he he.

again, thanks
sk

On 10/24/06, Thomas Mills Hinkle < [EMAIL PROTECTED]> wrote:
On 10/24/06, shawn bright <[EMAIL PROTECTED]> wrote:
ok, i have my tree view and populated with a list like the tutorial said, however, i need a way to refresh the list.
here is what i have so far

self.group_treeiter = self.group_model.get_iter_first()
self.group_model.clear ()
for name in name_list:
            self.treeiter = self.group_model.append(None,name)           
self.group_tree_view.set_model(self.group_model)
self.group_column = gtk.TreeViewColumn('Groups')
self.group_tree_view.append_column (self.group_column)
self.view = gtk.CellRendererText()
self.group_column.pack_start(self.view, True)
self.group_column.add_attribute(self.view, 'text', 0)

it works so far, but when i run it again, instead of clearing out the list view, it starts a new column.
this just cannot be. Anyone see off hand what i am doing wrong here?

All of the code relating to the treeview (as opposed to the tree model) should only be called once.

The idea here is that display (the treeview) and the underlying data model (treemodel) are separate. You set up a treeview with columns, etc., only once -- changes in the treemodel will then automatically be reflected in the display.

So the only call above that you need to repeat are:

self.group_model.clear ()
self.group_treeiter = self.group_model.get_iter_first()
for name in name_list:
            self.treeiter = self.group_model.append(None,name)           

Tom


_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to