beetlebug▾
/

grid slaves

Gives the widgets in the grid of a container, the last one first.

grid slaves CONTAINER ?-row N? ?-column N?

Description

Gives the names of the widgets in the grid of CONTAINER, in the reverse order of their entry into the grid. -row and -column keep only the widgets whose cells include that row or that column. grid content is the same command.

Returns

A list of widget names.

Examples

% frame .sl
> foreach n {a b c d} { frame .sl.$n }
> grid .sl.a .sl.b
> grid .sl.c .sl.d
> list [grid slaves .sl] [grid slaves .sl -row 0] [grid slaves .sl -column 1]
{.sl.d .sl.c .sl.b .sl.a} {.sl.b .sl.a} {.sl.d .sl.b}

Errors

% grid slaves .sl -foo 1
bad option "-foo": must be -column or -row
-errorcode NONE

% grid slaves .sl -row x
expected integer but got "x"
-errorcode TCL VALUE NUMBER

Facts

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

See also