tor 2003-01-02 klockan 11.51 skrev Christian Reis: > On Wed, Jan 01, 2003 at 09:27:25PM +0100, Ola wrote: > > I have a GtkCTree with two columns. if I try to access the text in > > column 0 I get an exception, if I try to access column 1 it works. Why? > > (or is there another, better whay to iterate through the data in the > > tree?) > > Well, the CTree is a pretty wierd widget. I have the same trouble as you > using get_text(), but I suspect it is because column 0 is the tree > column. Have you tried using node_get_text(node, column) instead? It > should work. Of course, you need to get a reference to the node - it's > returned by insert_node() IIRC, but you can also use node_nth(row).
It's not only weird is very crappy, old and even deprecated in Pygtk 2.0. Gtk 2.x provides a new much more flexible widget called GtkTreeView which together with GtkTreeStore replaces CTree. If you want a modern, convenient and capable of very advanced uses. I would suggest that you update to PyGtk2 (1.99.14 or higher) where lots of bug fixes and api additions has gone in. But bad part is that it's a new API, but unless you have lots of code using the old API in your applications it should be a problem, since it's quite easy to learn. -- Johan Dahlin <[EMAIL PROTECTED]> Async Open Source _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
