ztk::tree
Gives the widgets under a widget, with the class, the place, the size, and the map state of each.
Synopsis
ztk::tree ?PATHNAME?
Arguments
| Name |
Type |
Default |
Meaning |
PATHNAME |
widget path |
. |
The first widget of the list. |
Return value
A list with one item for PATHNAME and one for each widget under it, in the order of a depth-first walk. Each item is {PATH CLASS X Y WIDTH HEIGHT MAPPED}. X and Y are the place in the toplevel, and the numbers are logical pixels. MAPPED is 1 when the widget is mapped.
Errors
| Error |
When |
bad window path name "W" |
No widget has the name. |
wrong # args: should be "ztk::tree ?pathName?" |
More than one argument. |
| Platform |
Works |
| Windows |
Yes |
| macOS |
Yes |
| Linux, Wayland |
Yes |
| Linux, X11 |
Yes |
| Web |
Yes |
| iOS, Android |
Yes |
| Headless |
Yes |
Example
frame .f
button .f.ok -text OK
pack .f .f.ok
update
foreach w [ztk::tree .f] { puts [lrange $w 0 1] }
See also