TextSelection
A range of text that represents a selection.
Properties
- 
          base_offset(int) –The offset at which the selection originates. 
- 
          directional(bool) –Whether this selection has disambiguated its base and extent. 
- 
          end(int) –The next index after the characters in this range. 
- 
          extent_offset(int) –The offset at which the selection terminates. 
- 
          is_collapsed(bool) –Whether this range is empty (but still potentially placed inside the text). 
- 
          is_normalized(bool) –Whether the start of this range precedes the end. 
- 
          is_valid(bool) –Whether this range represents a valid position in the text. 
- 
          start(int) –The index of the first character in the range. 
Methods
- 
            get_selected_text–Returns the selected text from the given full text. 
Properties#
class-attribute
      instance-attribute
  
#
directional: bool = False
Whether this selection has disambiguated its base and extent.
property
  
#
end: int
The next index after the characters in this range.
Note
This property is read-only.
property
  
#
is_collapsed: bool
Whether this range is empty (but still potentially placed inside the text).
Note
This property is read-only.
property
  
#
is_normalized: bool
Whether the start of this range precedes the end.
Note
This property is read-only.
property
  
#
is_valid: bool
Whether this range represents a valid position in the text.
Note
This property is read-only.
property
  
#
start: int
The index of the first character in the range.
Note
This property is read-only.