beetlebug▾
/

ttk::notebook index

Gives the numeric index of a tab.

PATHNAME index TAB

Description

Gives the index from 0 of TAB. end gives the count of tabs. current gives the index of the selected tab, or an empty string with no tab.

Returns

An integer, or an empty string.

Examples

% ttk::notebook .tnbix
> foreach p {a b} {ttk::frame .tnbix.$p; .tnbix add .tnbix.$p}
> list [.tnbix index .tnbix.b] [.tnbix index end] [.tnbix index current]
1 2 0

Errors

% ttk::notebook .tnbix2; .tnbix2 index bogus
Invalid slave specification bogus
-errorcode NONE

Facts

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

See also