Rene Olsthoorn wrote:

Dear list-reader,

Using: pygtk 1.99.13(CVS of yesterday)

The GTK C reference says a GTKTreeIter has 4 attributes:
stamp, user_data, user_data2, user_date3

In Python however, the TreeIter object is not able to reach the attributes. So, I cannot tell what data is selected from my ListStore TreeView.

In the code, I do:
liststore, iter = self.treeview.get_selection().get_selected()

How can I get the information I want from the iter?
The liststore only has a set-method not a get-method.

A treeiter is meant to be opaque (even in C -- the definition is merely there so that you can allocate it on the stack, and for tree model implementations). If you want to get information about the row in the model pointed to by the iter, you will need to use the TreeModel APIs:
cell = liststore.get_value(iter, 0) # get the value in the first model column for the iter

James.

--
Email: [EMAIL PROTECTED] | Linux.conf.au http://linux.conf.au/
WWW: http://www.daa.com.au/~james/ | Jan 22-25 Perth, Western Australia.


_______________________________________________
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