beetlebug▾
/

listbox index

Gives the number of the item that INDEX names.

PATHNAME index INDEX

Description

Changes an index of any form to a number from 0. end gives the count of the items.

Returns

An integer.

Examples

% listbox .ix
> .ix insert end a b c
> .ix index end
3

Errors

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

% listbox .ix3; .ix3 index
wrong # args: should be ".ix3 index index"
-errorcode NONE

Facts

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

See also