With a ListStore (which is all I have worked with), you invoked the
clear() method. I didn't check the docs for the TreeStore, but I bet
it's very similar--if not identical.
On Thu, 2005-09-29 at 13:16 -0500, nephish wrote:
> hey there,
>
> i have an app with a treeview and treestore. it is only one column of
> customer names, then branched out from that (children, i suppose) would
> be the customers products. kinda like this:
>
> name1
> |_ product1
> |_ product2
>
> name2
> |_ product1
>
> and so on..
> so far i have been able to draw it ok, but i want to be able to refresh it.
>
> i have a refresh button that i use to draw it afresh, but it draws two
> of them
>
> how do i destroy it and recreate it?
>
> here is how its drawn
>
> for Name in Names:
> CuName = Name[0]
> CID = Name[1]
> self.treeiter = self.model.append(None,[CuName])
> cursor.execute("SELECT Field_ID FROM `Fields` WHERE
> Customer_ID = '"+CuName"' ")
> FieldsList = cursor.fetchall()
> for Field_n in FieldsList:
> Field_r = Field_n[0]
> self.treeiter2 =
> self.model.append(self.treeiter,[Field_r])
> self.CustTree.set_model(self.model)
> self.column = gtk.TreeViewColumn('Customers')
> self.CustTree.append_column(self.column)
> self.view = gtk.CellRendererText()
> self.column.pack_start(self.view, True)
> self.column.add_attribute(self.view, 'text', 0)
>
> thanks much
>
> shawn
>
> _______________________________________________
> pygtk mailing list [email protected]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/