Module: ATSPI::Accessible::Selectable

Included in:
ATSPI::Accessible, ErrorAccessible
Defined in:
lib/atspi/accessible/selectable.rb

Overview

Wraps libatspi’s AtspiSelection together with parts of Children and Children::Selected

Attributes & States collapse

Actions collapse

Instance Method Details

#deselecttrue, false

Deselects it

Returns:

  • (true, false)

    indicating success of the operation. false if its parent does not implement the selection interface.

See Also:



31
32
33
# File 'lib/atspi/accessible/selectable.rb', line 31

def deselect
  selectable? and parent.__send__(:native).deselect_child(index_in_parent)
end

#selecttrue, false

Selects it

Returns:

  • (true, false)

    indicating success of the operation. false if its parent does not implement the selection interface.

See Also:



22
23
24
# File 'lib/atspi/accessible/selectable.rb', line 22

def select
  selectable? and parent.__send__(:native).select_child(index_in_parent)
end

#selectable?true, false

Checks if it can be selected. Accessibles which parent’s native implements the selection interface are selectable.

Returns:

  • (true, false)


11
12
13
# File 'lib/atspi/accessible/selectable.rb', line 11

def selectable?
  parent.children.selectable?
end

#selected?true, false

Checks if it currently is selected

Returns:

See Also:



42
43
44
# File 'lib/atspi/accessible/selectable.rb', line 42

def selected?
  selectable? and parent.__send__(:native).is_child_selected(index_in_parent)
end