beetlebug▾
/

ttk::notebook select

Gives the page of the selected tab, or selects a tab.

PATHNAME select ?TAB?

Description

With no TAB, gives the path of the page of the selected tab, or an empty string. With TAB, selects it: the notebook shows its page, unmaps the page of the old tab, and sends <<NotebookTabChanged>>.

Returns

The path of a page, or an empty string.

Examples

% ttk::notebook .tnbse
> foreach p {a b} {ttk::frame .tnbse.$p; .tnbse add .tnbse.$p}
> .tnbse select 1
> .tnbse select
.tnbse.b

% ttk::notebook .tnbse3
> foreach p {a b} {ttk::frame .tnbse3.$p; .tnbse3 add .tnbse3.$p}
> update
> bind .tnbse3 <<NotebookTabChanged>> {lappend ::tnbchanged [%W select]}
> .tnbse3 select 1
> update
> set ::tnbchanged
.tnbse3.b

Errors

% ttk::notebook .tnbse2; ttk::frame .tnbse2.a; .tnbse2 select .tnbse2.a
.tnbse2.a is not managed by .tnbse2
-errorcode NONE

Facts

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

See also