beetlebug▾
/

entry insert

Inserts TEXT before the character at INDEX.

PATHNAME insert INDEX TEXT

Description

Puts TEXT into the entry before INDEX. With -validate, the validation runs first and can reject the change. An entry with -state disabled or readonly keeps its text.

Returns

An empty string.

Examples

% entry .in
> .in insert 0 world
> .in insert 0 "hello "
> .in get
hello world

# A readonly entry keeps its text.
% entry .in2 -state readonly
> .in2 insert 0 abc
> .in2 get

Errors

% entry .in3; .in3 insert
wrong # args: should be ".in3 insert index text"
-errorcode NONE

% entry .in4; .in4 insert foo x
bad entry index "foo"
-errorcode NONE

Facts

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

See also