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

root x/y to window x/y

9 views
Skip to first unread message

Deanna Delapasse

unread,
May 20, 1996, 3:00:00 AM5/20/96
to

HELP !!

I'm trying to place a tk_popup menu onto a line in my textwidget at
a specific x/y location. I've bound to <Button-2> and I get %x and %y,
but tk_popup requires root coordinates. Apparently the %x and %y
coordinates are relative to my text widget. How can I convert ?

And if this is in the man pages please let me know where to look.
I searched from 10 different keywords.

Thanks a lot !

Deanna Delapasse

(if possible, send answers to ddela...@simsci.com)

--
#############################################
Deanna Delapasse Simulation Sciences, Inc
ddela...@simsci.com
#############################################

Jeffrey Hobbs

unread,
May 22, 1996, 3:00:00 AM5/22/96
to

In article <Drq06...@cadserv1.tedix.sccsi.com>,

Deanna Delapasse <d...@cadserv1.tedix.sccsi.com> wrote:
>a specific x/y location. I've bound to <Button-2> and I get %x and %y,
>but tk_popup requires root coordinates. Apparently the %x and %y

Use %X and %Y instead.
--
Jeffrey Hobbs Office: 541/346-3998
Univ of Oregon CIS GRF email: jho...@cs.uoregon.edu
URL: http://www.cs.uoregon.edu/~jhobbs/

Michael Salmon

unread,
May 23, 1996, 3:00:00 AM5/23/96
to

Deanna Delapasse wrote:
>
> HELP !!
>
> I'm trying to place a tk_popup menu onto a line in my textwidget at
> a specific x/y location. I've bound to <Button-2> and I get %x and %y,
> but tk_popup requires root coordinates. Apparently the %x and %y
> coordinates are relative to my text widget. How can I convert ?
>
> And if this is in the man pages please let me know where to look.
> I searched from 10 different keywords.

Strangely enough you can find the information on the man page for bind.

--
© 1995,1996 Michael Salmon
All opinions expressed in this article remain the property of
Michael Salmon. Permission is hereby granted for use in
followup articles, FAQ's and digests.

Bryan Oakley

unread,
May 23, 1996, 3:00:00 AM5/23/96
to ddela...@simsci.com

Deanna Delapasse wrote:
>
> HELP !!
>
> I'm trying to place a tk_popup menu onto a line in my textwidget at
> a specific x/y location. I've bound to <Button-2> and I get %x and %y,
> but tk_popup requires root coordinates. Apparently the %x and %y
> coordinates are relative to my text widget. How can I convert ?
>
> And if this is in the man pages please let me know where to look.
> I searched from 10 different keywords.

Look in the man page for bind. What you want to do is use %X and %Y
instead of %x and %y. The upcase variety gives you the root x,y
coordinates of the event. That way you don't have to do any conversion.

--
Bryan Oakley, Software Engineer
Healthcare Communications, Inc.
oak...@healthcare.com

0 new messages