Class: ATSPI::Accessible::Text::Selection

Inherits:
Range
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/atspi/accessible/text/selection.rb

Overview

Represents a selected range in a ATSPI::Accessible::Text.

Actions collapse

Instance Method Details

#deselecttrue, false

Deselects itself.

Returns:

  • (true, false)

    indicating success

See Also:



20
21
22
# File 'lib/atspi/accessible/text/selection.rb', line 20

def deselect
  @text_native.remove_selection(@idx)
end

#move_end_to(new_end_offset) ⇒ true, false

Moves its end to the given offset.

Parameters:

  • new_end_offset (responds to #to_i)

Returns:

  • (true, false)

    indicating success

See Also:



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

def move_end_to(new_end_offset)
  @text_native.set_selection(@idx, start, new_end_offset.to_i)
end

#move_start_to(new_start_offset) ⇒ true, false

Moves its start to the given offset.

Parameters:

  • new_start_offset (responds to #to_i)

Returns:

  • (true, false)

    indicating success

See Also:



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

def move_start_to(new_start_offset)
  @text_native.set_selection(@idx, new_start_offset.to_i, self.end)
end