473,809 Members | 2,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

(PyGTK) Disabling ToolButton when no TreeView item is selected?

I have a TreeView and a ToolButton. The ToolButton should only be
active if the user has selected an item in the TreeView. What signal
should I use to achieve this?

Thanks,
David

Dec 28 '06 #1
2 1432
cypher543 skrev:
I have a TreeView and a ToolButton. The ToolButton should only be
active if the user has selected an item in the TreeView. What signal
should I use to achieve this?

Thanks,
David
Hey

I use the "curselection() " function.

Example:
id = self.listbox.cu rselection()
id = id[0]
rf = self.listbox.ge t(id)
print id

It is on a listbox, but a think you also can use it on TreeViews.

Hope it helped! :)

--
_________ .__ __ ______________
/ _____/ ___________|__| ______/ |_ ___________ / | \______ \
\_____ \_/ ___\_ __ \ \____ \ __\/ __ \_ __ \/ | |_ / /
/ \ \___| | \/ | |_ | \ ___/| | \/ ^ / / /
/_______ /\___ >__| |__| __/|__| \___ >__| \____ | /____/
\/ \/ |__| \/ |__|

Dec 28 '06 #2

"cypher543" <da***@cyphersp ace.infowrote:

I have a TreeView and a ToolButton. The ToolButton should only be
active if the user has selected an item in the TreeView. What signal
should I use to achieve this?
you can try using the configure method on the toolbutton in the
command that is executed when the tree view is selected/deselected

- Hendrik

Dec 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1464
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 track of the current active item (not selected, think playlist in som sort of media player). I then read a very good GTK 2 Tree View tutorial (http://scentric.net/tutorial/), written for C. He speaks of the GtkTreeRowReference object which seem to be...
4
1629
by: j_mckitrick | last post by:
I am having a problem with combo boxes. If I am using an XML glade2 file for my gui definition, what is the command I need to use to access a given combo box and determine the currently selected item? jonathon
2
3359
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 progressbar and ListStore: basically i need to make pulse the progressbar while i'm copying files and write filenames copied on the ListStore on to the window.
0
2129
by: Franck Pommereau | last post by:
Hi all, I'm building a PyGTK interface in which I would like that no widget would be able to get the focus (and so to be activated by pressing the Return key). For this purpose, for each widget, I do: widget.set_property("can-focus", gtk.FALSE) My problem is a TreeView which has a clickable column, it get the default focus and I did not find how to forbid that.
0
1294
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 : http://www.pygtk.org/pygtk2tutorial/examples/filelisting.py) I'd like to be able to use a virtual list (like wx.ListCtrl in mode LC_VIRTUAL) ...
2
7503
by: Tymbow | last post by:
I'm building a web application that is analogous to the Windows XP file explorer in function. The left column contains a TreeView, and the right column a DataGrid populated by selecting TreeView nodes. The TreeView populates dynamically as there are a significant number of nodes. The DataGrid displays both the items and the nodes from the TreeView. Using the explorer analogy this means the TreeView shows folders, and the DataGrid folders...
0
1259
by: Chris Johnson | last post by:
Good morning. I have recently begun a project using PyGTK, and part of my planned interface has a gtk.TreeView showing a portion of the filesystem. Now, rather than load the entire FS structure into the tree right from the beginning, I made a lazy tree by adding blank children to rows representing directories, and connected a call to fill in the data when a row with blank children was expanded. Now, this works all fine and well, in...
1
3749
by: Guillermo Heizenreder | last post by:
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 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.
0
3315
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. Provide following view properties to listview, through View menu a. Tile b. Icon
0
9722
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10643
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10378
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10121
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.