Robert Nikander wrote:
> Hi again,
>
> I have just about got my app working with the new pygtk... but just a
> few more questions!
>
> In short...
> 1. Does TreeStore/ListStore remove() work? I don't see a 'bug' in
> bugzilla, but then I am having trouble querying the thing.
Removing rows works fine for me. Just get an iter for the row you want
removed, and call model.remove(iter). You can get an iter for a row
with the model.get_iter() method. This takes a variable number of
arguments giving the path of the iter in the tree. For example to get
the 7th child node of the 2nd toplevel node, you would use:
iter = model.get_iter(1, 6)
>
> 2. Can you get data back out of a List/Tree store? If not, can you
> avoid duplication of data when using them?
Yes. Both GtkTreeStore and GtkListStore implement the GtkTreeModel
interface. The GtkTreeModel interface is used to get information out of
the model (and perform notification when the information changes). If
you have an iter for the desired row, you can do:
value_in_first_column = model.get_value(iter, 0)
James
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk