[FIX] Pop-up Menu Location

Doug Way dway at mat.net
Wed Aug 4 18:24:44 UTC 1999


Currently in Squeak, pop-up menus usually appear just to the right of the
mouse cursor.  This is fine, but when the mouse is near the right edge of
the screen, the pop-up menu is justified with the right edge so that the
mouse is inside the menu. 

This can result in pop-up menu items being accidentally selected with a
stray mouse click... usually the first item in the menu might be selected,
although if you're near the lower-right corner of the screen, any item
might be selected, sometimes with bad results.  (One time a stray click
near the lower right corner in Morphic brought up the system pop-up menu
over the "save and quit" option, which caused me to save a bad image over
a good one.) 

The following changeset prevents these accidents by bringing up pop-up
menus just to the left of the mouse cursor, only when there's not enough
room on the screen for it to fit on the right.  This is a common strategy
for pop-up menus in other UI's.  The changeset is at: 

http://www.mindspring.com/~dway/smalltalk/MenuLocationFix-dew.cs

This is basically a simple one-line change to two methods, one for Morphic
and one for MVC.  It should be safe to go in the base image, whenever
appropriate.  (As opposed to my HiddenScrollBar changeset, which probably
doesn't really need to be in the base image. :-) ) 

- Doug Way
  EAI/Transom Technologies, Ann Arbor, MI
  http://www.transom.com
  dway at eai.com, dway at mat.net





More information about the Squeak-dev mailing list