beetlebug▾
/

winfo geometry

Gives the size and the position of a widget, in the form WIDTHxHEIGHT+X+Y.

winfo geometry WINDOW

Description

The position is relative to the parent of the widget, or to the screen for a toplevel. A widget that has had no layout gives 1x1+0+0. Call update first for the current values.

Returns

A geometry string.

Examples

% frame .f -width 40 -height 30
> pack .f
> frame .f.b -width 20 -height 10
> place .f.b -x 5 -y 6
> update
> winfo geometry .f.b
20x10+5+6

% frame .g1
> winfo geometry .g1
1x1+0+0

Errors

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

% winfo geometry .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