beetlebug▾
/

text get

Gives the characters from INDEX1 up to INDEX2.

PATHNAME get ?-displaychars? ?--? INDEX1 ?INDEX2 ...?

Description

Gives the characters from INDEX1 up to the place before INDEX2, or the one character at INDEX1. With more pairs of indices, gives a list of the texts of the ranges. With -displaychars, leaves out the elided text. Images and widgets give no characters.

Returns

The text, or a list of texts.

Examples

# The content always ends with a newline.
% text .ge
> .ge insert end "abc\ndef"
> .ge get 1.0 end
abc
def


% text .ge2
> .ge2 insert end "abc\ndef"
> .ge2 get 1.0 1.2 2.0 2.1
ab d

Errors

% text .ge3; .ge3 get
wrong # args: should be ".ge3 get ?-displaychars? ?--? index1 ?index2 ...?"
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also