simvx.core.ui.text_selection

Selection, clipboard and word boundaries shared by the text-editing widgets.

TextEdit places its caret at a character offset and MultiLineTextEdit at a (line, column) pair. Both order with <, so one set of selection and clipboard methods serves both: a widget supplies its caret as _caret and the two text operations _text_between and _remove_between.

Module Contents

Classes

TextSelectionMixin

Selection and clipboard for a text widget whose caret positions order with <.

Data

API

simvx.core.ui.text_selection.__all__

[‘TextSelectionMixin’]

class simvx.core.ui.text_selection.TextSelectionMixin

Selection and clipboard for a text widget whose caret positions order with <.

The selection runs from _select_start, the anchor, to _select_end, which follows the caret; None at either end means nothing is selected. A widget using it provides _caret (read and assigned), _text_between, _remove_between, insert and a text_changed signal.

copy() → None

Copy the selected text to the clipboard.

cut() → None

Copy the selected text to the clipboard and remove it.

paste() → None

Insert the clipboard’s text at the caret, replacing the selection.