Return window related information.
http://www.purl.org/tcl/home/man/tcl8.4/TkCmd/winfo.html
See wm for Window manager related information.
winfo atom ?-displayof window? name winfo atomname ?-displayof window? id winfo cells window winfo children window winfo class window winfo colormapfull window winfo containing ?-displayof window? rootX rootY winfo depth window winfo exists window winfo fpixels window number winfo geometry window winfo height window winfo id window winfo interps ?-displayof window? winfo ismapped window winfo manager window winfo name window winfo parent window winfo pathname ?-displayof window? id winfo pixels window number winfo pointerx window winfo pointerxy window winfo pointery window winfo reqheight window winfo reqwidth window winfo rgb window color winfo rootx window winfo rooty window winfo screen window winfo screencells window winfo screendepth window winfo screenheight window winfo screenmmheight window winfo screenmmwidth window winfo screenvisual window winfo screenwidth window winfo server window winfo toplevel window winfo viewable window winfo visual window winfo visualid window winfo visualsavailable window ?includeids? winfo vrootheight window winfo vrootwidth window winfo vrootx window winfo vrooty window winfo width window winfo x window winfo y window
Notice that the return value of [winfo id ...] is the id used by toplevel and wish in
toplevel ... -use $id
and
wish ... -use $id
Here's an example:
label .t1 -text Above label .t2 -text Below frame .holder -container 1 pack .t1 .holder .t2 exec wish other_application.tcl -use [winfo id .holder] &
[Include an image here.]
Incidental remark: when CL substitutes
exec tclkit tiny.tcl -use [winfo id .holder] &
for that last line, while running on WinNT, with tiny.tcl having content
pack [.button -text "Push me" -command exit]
everything comes up OK. When the button is pushed, "Dr. Watson" appears. Dismissing it eventually results in a whited-out frame "hole" in the embedding Wish. Is this an error in TclKit 8.4a3?
It's probably time to make separate pages for "winfo atom", "winfo exists", "winfo id", and so on.
In any case, note that "winfo rgb" is not idempotent (or surjective) over the space of decimal triples. CL believes that the point is that the range space of "winfo rgb" is the display's color palette (is that the right GUI vernacular?), and is thus smaller than the full cartesian product ([0-65535],[0-65535],[0-65535]) one might otherwise expect.
This presented with VNC service for which
winfo rgb . #ffff1fffffff
is
65535 0 65535
rather than the
65535 7967 65535
delivered by a better-endowed display.
A start to a work-around for this is ...
Category Command | Tk syntax help | Arts and Crafts of Tcl-Tk Programming