Canvas popup menus in suntools

Chuck Musciano chuck at trantor.harris-atd.com
Tue Aug 22 21:49:15 AEST 1989


> Now I have scrollbars with the canvas. If
> the canvas is unscrolled then menu pops up right where the mouse button is
> pressed. But if the canvas has been scolled away from zero position then
> the menu pops at weird places, like one corner of the entire screen.

When you call menu_show(), it needs the event which initiated the request
and the window it occured in.  I believe the menu package uses this event
to determine where the menu will be displayed, and which button up event
signifies a selection in the menu.  If you have a scrolling canvas, the
event coordinate space has been translated by your scrolling, and this
probably confuses the menu package.  I believe there is a routine which
translates from canvas to world coordinates, which you might want to use
to adjust the event location before calling menu_show().

Chuck Musciano				ARPA  : chuck at trantor.harris-atd.com
Harris Corporation 			Usenet: ...!uunet!x102a!trantor!chuck
PO Box 37, MS 3A/1912			AT&T  : (407) 727-6131
Melbourne, FL 32902			FAX   : (407) 727-{5118,5227,4004}

Gee, Beaver, everything's that fun can get you in trouble.  Haven't you
learned that yet? --Gilbert



More information about the Comp.sys.sun mailing list