By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,995 Members | 1,217 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,995 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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.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! :)

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

Dec 28 '06 #2

P: n/a

"cypher543" <da***@cypherspace.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 discussion thread is closed

Replies have been disabled for this discussion.