471,337 Members | 912 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

[pygtk] problem with TreeView + ListStore

Hi list
I'm developing a application for learn pygkt, and I need to know when a
user selected or clicked one determinate row of my TreeView for shot
another signal .

Study the tutorial [1] I began to see the explanation that I see in the
chapter 14.7. TreeView Signal and found one in particular
"select-cursor-row", but I don't understood how implementing.

Something like that.
if user_selected_row:
self.hbox_118.show()
print "YES"

NOTE: self.hbox_118 = wTree.get_widget("hbox118")

Thank and Regard

[1] http://www.pygtk.org/pygtk2tutorial/...ewSignals.html

P/D: my English it to bad, I'm a novice.
--
Heizenreder Guillermo
http://code.google.com/u/gheize/

Sep 4 '07 #1
1 3610
Ali
On Sep 4, 10:43 am, Guillermo Heizenreder <ghe...@gmail.comwrote:
Hi list
I'm developing a application for learn pygkt, and I need to know when a
user selected or clicked one determinate row of my TreeView for shot
another signal .
Hi,

Well, ignoring the rest of the post, I can tell you that the usual way
of
doing this is to connect the changed signal of the treeview's
selection.

This explains it better than I would:

http://faq.pygtk.org/index.py?req=sh...=faq13.011.htp

Now to complete your actual use case:

def on_selection_changed(selection, *args):
model, paths = selection.get_selected_rows()
if paths:
hbox.show()

treeView = gtk.TreeView()
selection = self.treeView.get_selection()
selection.connect('changed', on_selection_changed)

There are some situations where you may want to actually connect the
mouse click event, and we can discuss them further if you require.

I should of course mention kiwi.ui.objectlist.ObjectList. It is an
easier to use abstraction over TreeView, and has helped me in every
situation where I would use a TreeView.
Ali
Study the tutorial [1] I began to see the explanation that I see in the
chapter 14.7. TreeView Signal and found one in particular
"select-cursor-row", but I don't understood how implementing.

Something like that.
if user_selected_row:
self.hbox_118.show()
print "YES"

NOTE: self.hbox_118 = wTree.get_widget("hbox118")

Thank and Regard

[1]http://www.pygtk.org/pygtk2tutorial/sec-TreeViewSignals.html

P/D: my English it to bad, I'm a novice.
--
Heizenreder Guillermohttp://code.google.com/u/gheize/

Sep 4 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Andre Lerche | last post: by
reply views Thread by Martin Andersson | last post: by
2 posts views Thread by Samuele Giovanni Tonon | last post: by
reply views Thread by manatlan | last post: by
reply views Thread by sapo | last post: by
reply views Thread by mailbinoy | last post: by
1 post views Thread by binaryjesus | last post: by
reply views Thread by Michael Palmer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.