James Henstridge <[EMAIL PROTECTED]> writes:
> I added a quick modification to the GtkListStore wrapper so the
> following is now possible:
>
> >>> import gtk
> >>> store = gtk.ListStore(int, int, str, str)
nice. Can I do 'object' too?
> >>> store.append()
> <GtkTreeIter at 0x81a8b80>
> >>> len(store)
> 1
> >>> store[0]
> <gtk.gtk.ListStoreRow object at 0x81a8638>
> >>> store[0][0]
> 0
> >>> store[0][0] = 42
> >>> store[0][2] = 'foo'
> >>> store[0][0], store[0][2]
> 42, 'foo'
Looks really nice.
> I plan to add some more features:
>
> * support for this to GtkTreeStore (so you could do
> treestore[0,3][0] = 42)
> * support for row deletion
> * support for assignments (eg. store[0] = (1,2,'foo','bar'))
> * an __iter__ slot for GtkListStore (which would return a sequence
> ofthese row objects).
> * maybe add __iter__ for tree stores too (iterates over the toplevel
> nodes, and iter(row) would iterate over the child nodes).
so it would be:
for row in tree:
for row2 in row:
...
I kinda would have expected that to iterate over values. This may be
more convenient, though.
Thanks,
-Jonathan
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/