472,975 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,975 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 3700
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.