Active Topics

 


Reply
Thread Tools
Posts: 316 | Thanked: 150 times | Joined on May 2006
#1
I don't know wether this is a Maemo, GTK, PyGTK or just 'me' issue.

Bear in mind that I've not done any desktop coding (outside of Java/SWT) for abour five years .. i.e. my GTK-foo is very rusty and/or obsolete. Also I'm using this as an exercise to learn Python.

My primary concern is that I am hitting a problem with a treeview. I have one inserted into a pannablearea. Data goes in and is displayed and branches expand. The problem is that they don't collapse again. Is there a property or attribute that I've missed?

In attempting to work around this, I figured that binding to one of the row signals may give me notification that the user is attempting to collapse a branch. The docs at http://www.pygtk.org/pygtk2tutorial/...ewSignals.html describe the call-back template I should use :
Code:
def callback(treeview, iter, path, user_data)
with treeview being a gtk.TreeView, iter being a gtk.TreeIter and path being a path descriptor to a location in the tree. All simple enough and is right on the money when a row-expanded signal is emitted.
When a 'row-activated' signal is sent, I get a different set of parameters. I get the gtk.TreeView but 'iter' is set to what looks like a path descriptor and 'path' is a gtk.TreeViewColumn

Am I going nuts, doing something crazily wrong or is my machine just trying to send me batty?
Attached Files
File Type: txt mainWindow2.py.txt (2.3 KB, 137 views)
 
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#2
Hi,

Originally Posted by jaark View Post
When a 'row-activated' signal is sent, I get a different set of parameters. I get the gtk.TreeView but 'iter' is set to what looks like a path descriptor and 'path' is a gtk.TreeViewColumn
I think this part of the documentation is not clear enough. Not all of the signals have the same set of parameter. Check the detailed documentation about the Treeview signals.

Daniel
 

The Following User Says Thank You to danielwilms For This Useful Post:
Posts: 316 | Thanked: 150 times | Joined on May 2006
#3
What I'd read seemed so straight-forward and matter of fact that that it was plain wrong never even crossed my mind. Cheers!
 
Reply


 
Forum Jump


All times are GMT. The time now is 18:10.