473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 3727
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andre Lerche | last post by:
Hi list, I am quite new to Python and try to learn Python with a small pygtk program. I am facing a problem which I am unable to solve for myself. I think I have read the documentation and some...
0
by: Martin Andersson | last post by:
Hi. Im currently working on a Python GTK2 app which uses a TreeView (data contained in a ListStore). As I am utilizing the drag-to-reorder feature of the TreeView I needed some way to keep...
2
by: Samuele Giovanni Tonon | last post by:
hi, i'm trying to develop a trivial application which random copy files from a directory to another one. i made it using pygtk for the graphical interface, however i find some problem with...
0
by: manatlan | last post by:
Hello, I'm new to pygtk (but i know wxpython very well) I'm trying to play with this example : http://www.pygtk.org/pygtk2tutorial/sec-CellRenderers.html#filelistingfig (the code is here :...
0
by: sapo | last post by:
Hi all, i m trying to make an editable list with a toggle button, it shows up and i can edit the list.. but its editing the wrong cell! If i click on the toggle button on the first cell it sets...
0
by: sapo | last post by:
This is my code: def list(self): tree = self.principal.get_widget("list") self.list = gtk.ListStore(bool,str) self.options = renderer1 = gtk.CellRendererToggle()...
0
by: mailbinoy | last post by:
hi, i am writing a app which has a treeview. i am using a liststore to update the tree tmplist= self.liststore.append(tmplist) i am also 'pickling' the list to a file. . the app has a option...
1
by: binaryjesus | last post by:
hi group i am running into a problem with gtk. i have a treeview that just displays tabular data (no down arrows or trees etc). it has 5 columns. The tiny problem i am having is that it is just...
0
by: Michael Palmer | last post by:
On Sep 16, 12:30 pm, binaryjesus <coolman.gu...@gmail.comwrote: I haven't tried it myself, but I came across a blog post the other day that describes a way of building windows installers for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.