UI module

has_selection

procedureextensionexperimentalsince 0.31.0Source

Whether any text is selected.

Example↗
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "abc");
assert(!has_selection(*edit));
select_all(*edit);
assert(has_selection(*edit));
has_selection :: (edit: *Text_Edit) -> bool

Whether any text is selected.

Parameters

edit: *Text_Edit
the text being edited.

Returns

bool
Example↗
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "abc");
assert(!has_selection(*edit));
select_all(*edit);
assert(has_selection(*edit));

See also