Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old September 4th, 2007, 10:45 AM
Guillermo Heizenreder
Guest
 
Posts: n/a
Default [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/

  #2  
Old September 4th, 2007, 03:35 PM
Ali
Guest
 
Posts: n/a
Default Re: problem with TreeView + ListStore

On Sep 4, 10:43 am, Guillermo Heizenreder <ghe...@gmail.comwrote:
Quote:
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
Quote:
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/

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles