TreeViewSelectItem question

Class library usage, coding and language questions.
jasong
Posts: 49
Joined: Fri Oct 26, 2007 9:38 pm
Location: Texas

TreeViewSelectItem question

Post by jasong » Thu Nov 29, 2007 7:11 pm

I used the following:

Code: Select all

TreeViewSelectPath(control, 'level1/level2')
parent = TreeViewGetSelectedItem(control)
child = TreeViewGetChildItem(control, parent)
TreeViewSelectItem(control, child)
what I get is an 'argument error' for TreeViewSelectItem.

I have verified with TreeViewGetItemText that the child item handle is correct.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Fri Nov 30, 2007 4:43 pm

Sorry, this is a bug in the Python documentation, the second argument of the function should be the text of the item and not the handle.
See also the sample TreeViewTest in the Ranorex Scripts directory.

Please use the following code:

Code: Select all

TreeViewSelectPath(control, 'level1/level2') 
parent = TreeViewGetSelectedItem(control) 
child = TreeViewGetChildItem(control, parent) 
childText = TreeViewGetItemText(treeView,child)
TreeViewSelectItem(control, childText)     
We have corrected the documentation for the next release.

Jenö
Ranorex Support Team