I added a quick modification to the GtkListStore wrapper so the 
following is now possible:

     >>> import gtk
     >>> store = gtk.ListStore(int, int, str, str)
     >>> 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'

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).

Any comments/suggestions for this?

James.

-- 
Email: [EMAIL PROTECTED]              | Linux.conf.au 2003 Call for Papers out
WWW:   http://www.daa.com.au/~james/ |   http://conf.linux.org.au/cfp.html



_______________________________________________
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