Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tk Question - How to identify coordinates of elements/widgets within a frame?

0 views
Skip to first unread message

Hobot

unread,
Nov 27, 2009, 3:51:56 AM11/27/09
to
Is there a way to determine where all my Tk elements are in relation
to each other and the size of the area they occupy?

e.g.

button .c.one is located at 25,50 to 50,60
button .c.two is located at 75,50 to 100,60
button .c.three is located at 25,80 to 100,90

Arndt Roger Schneider

unread,
Nov 27, 2009, 4:50:17 AM11/27/09
to
Hobot schrieb:

winfo x .c.one;
winfo y .c.one;
winfo width .c.one;
winfo reqwidth .c.one;
...

Prefer to use:
winfo rootx .c.one
winfo rooty .c.one;

See manual page winfo.

When .c is a canvas and manages .c.one:
.c canvasx [winfo x .c.one]
...

-roger

Hobot

unread,
Nov 27, 2009, 5:07:37 AM11/27/09
to

Thanks very much roger

0 new messages