| | |
Programmatically Select item in TreeCtrl
Thread Solved |
•
•
Join Date: Nov 2008
Posts: 41
Reputation:
Solved Threads: 1
Hi. I have tree control with a structure already in it.
A function returns a string that matches one of the items in the tree control structure (They are all Unique), and I need to select that item in the tree. It doesn't matter if the code underlying a selection change runs or not, only that the item identified by the string is seen to be selected.
I am having real problems with this. To start with I'm not sure how to find the actual item in the first place, at least not without running through the entire tree structure and trying to match the label of each tree item to the string that I have.
Even if I were able to do this, I'm still in the dark about how to select the item.
Can anyone help please
Thanks
Max
A function returns a string that matches one of the items in the tree control structure (They are all Unique), and I need to select that item in the tree. It doesn't matter if the code underlying a selection change runs or not, only that the item identified by the string is seen to be selected.
I am having real problems with this. To start with I'm not sure how to find the actual item in the first place, at least not without running through the entire tree structure and trying to match the label of each tree item to the string that I have.
Even if I were able to do this, I'm still in the dark about how to select the item.
Can anyone help please
Thanks
Max
•
•
Join Date: Nov 2008
Posts: 41
Reputation:
Solved Threads: 1
Doh! I already answered this myself in another project - the relevant code can be found here:http://www.daniweb.com/forums/post74...tml#post743573
Max
Max
![]() |
Other Threads in the Python Forum
- Previous Thread: Music in Python
- Next Thread: how to copy a file
| Thread Tools | Search this Thread |
address aliased anydbm bash beginner bits calling casino changecolor class clear conversion convert corners count cturtle cursor curves definedlines dictionary digital dynamic dynamically events examples excel external file float format frange function gui handling hints homework i/o iframe import info input java line linux list lists loan loop matching mouse multiple number numbers output parsing path port prime programming projects py py2exe pygame python random rational raw_input recursion recursive scrolledtext searchingfile shebang signal singleton string strings subprocess table tails terminal text thread threading time tkinter tlapse tooltip tuple tutorial type ubuntu unicode urllib urllib2 valueerror variable web-scrape whileloop word wxpython





