Method: AutoItX3::TreeView#selected

Defined in:
lib/AutoItX3/control.rb

#selected(use_index = false) ⇒ Object

Returns where to find the selected item.

Parameters

use_index

(false) If this is true, you only get the last index.

Return value

If use_index is false, which is the default, you get a string back that describes where you find the currently selected item. The string is of form

"#index_0|#index_1|#index_3..."

for example

"#0|#3|#0|#10|#1|#0"

for the “ControlClick” item in the AutoItX help. Otherwise, if use_index is false, you only get the last index of that chain, as an integer.

Raises

Au3Error

Control or window not found.

Example

See Return value.

Remarks

You can pass the result of this method directly to many methods of this class.



945
946
947
948
949
# File 'lib/AutoItX3/control.rb', line 945

def selected(use_index = false)
  result = send_command_to_tree_view("GetSelected", use_index ? 1 : 0)
  return result.to_i if use_index
  result
end