beetlebug▾
/

winfo rooty

Gives the y position of the top edge of a widget on the screen.

winfo rooty WINDOW

Description

The position includes the position of the toplevel. Call update first for the current value.

Returns

An integer.

Examples

% frame .f -width 40 -height 30
> pack .f
> frame .f.b -width 20 -height 10
> place .f.b -x 5 -y 6
> update
> expr {[winfo rooty .f.b] - [winfo rooty .]}
6

Errors

% winfo rooty
wrong # args: should be "winfo rooty window"
-errorcode NONE

% winfo rooty .nope
bad window path name ".nope"
-errorcode NONE

Facts

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