Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 28th, 2006, 05:05 PM
cypher543
Guest
 
Posts: n/a
Default (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

  #2  
Old December 28th, 2006, 05:35 PM
Scripter47
Guest
 
Posts: n/a
Default Re: SPAM-LOW: (PyGTK) Disabling ToolButton when no TreeView itemis selected?

cypher543 skrev:
Quote:
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.curselection()
id = id[0]
rf = self.listbox.get(id)
print id

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

Hope it helped! :)

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

  #3  
Old December 29th, 2006, 05:55 AM
Hendrik van Rooyen
Guest
 
Posts: n/a
Default Re: (PyGTK) Disabling ToolButton when no TreeView item is selected?


"cypher543" <david@cypherspace.infowrote:

Quote:
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

 

Bookmarks

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