beetlebug▾
/

listbox delete

Deletes the items from FIRST to LAST.

PATHNAME delete FIRST ?LAST?

Description

Deletes the items from the index FIRST to the index LAST, both included. With no LAST, deletes the one item at FIRST. A listbox with -state disabled keeps its items.

Returns

An empty string.

Examples

% listbox .de
> .de insert end a b c d
> .de delete 1 2
> .de get 0 end
a d

% listbox .de2
> .de2 insert end a b c
> .de2 delete end
> .de2 get 0 end
a b

Errors

% listbox .de3; .de3 delete
wrong # args: should be ".de3 delete firstIndex ?lastIndex?"
-errorcode NONE

% listbox .de4; .de4 delete foo
bad listbox index "foo": must be active, anchor, end, @x,y, or a number
-errorcode NONE

Facts

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

See also