Re: [pygtk] list like behaviour for GtkListStore
On Sun, Jul 14, 2002 at 10:51:42AM +0800, James Henstridge wrote: Christian Reis wrote: Will append() take arguments? I found this a bit odd in the API. I have been considering it. It is probably a good idea, as it gives better compatibility with python lists. As it is, append() adds an empty line, I assume? It represents a tree path. store[0] - store[n] are the top level nodes in the tree. store[0,0] - store[0,n] are the children of the first node. store[0,1,0] - store[0,1,n] are the children of the second child of the first toplevel node. So store[0,3] represents the forth child of the first toplevel node. Trees demand complicated explanations. :-) Looks good. Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] list like behaviour for GtkListStore
On Sat, Jul 13, 2002 at 12:36:35PM +0800, James Henstridge wrote: 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 Will append() take arguments? I found this a bit odd in the API. * support for this to GtkTreeStore (so you could do treestore[0,3][0] = 42) [0,3] - is this like Numeric uses? * support for assignments (eg. store[0] = (1,2,'foo','bar')) Yep, looks cool. I don't know iterators very well, not enough to comment. Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] list like behaviour for GtkListStore
Christian Reis wrote: On Sat, Jul 13, 2002 at 12:36:35PM +0800, James Henstridge wrote: 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 Will append() take arguments? I found this a bit odd in the API. I have been considering it. It is probably a good idea, as it gives better compatibility with python lists. * support for this to GtkTreeStore (so you could do treestore[0,3][0] = 42) [0,3] - is this like Numeric uses? It represents a tree path. store[0] - store[n] are the top level nodes in the tree. store[0,0] - store[0,n] are the children of the first node. store[0,1,0] - store[0,1,n] are the children of the second child of the first toplevel node. So store[0,3] represents the forth child of the first toplevel node. * support for assignments (eg. store[0] = (1,2,'foo','bar')) Yep, looks cool. I don't know iterators very well, not enough to comment. 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/