[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting stuff to HAPPEN while in an event handler



On Fri Mar 17, Chris Crone writes:
  I'd like to be able to add a pop-up menu from the view click event handler,
  and allow the user to select from it, all in the same click/drag (not by
  making the popup a subview, though).  Has anyone done this?  The way I see
  it, menus do something similar (i.e. add some stuff to themselves as soon
  as the user clicks, etc), but I haven't been able to find the  methods used
  there.

Instead of a pop-up menu, consider a floating pop-up menu. To invoke the
menu, press the mouse-button over the view (for a minimum length of time).
The menu will then pop up. In essence, the menu is associated with the view
and not with the window but the menu is not a sub-view!

There is a strong connection between the "floating" pop-up menu and
marking menu, radial, or pie menu.
This menu has the advantage that the selection
depends on the angle, not the distance. [Remember how often you may go
beyond a menu item or stop too far before it?]. The marking menu technique
is faster than pull-down/pop-up menus. In addition to the advantage of
discriminating by angle, not distance, the technique allows the user
to select "eyes-free" and to make a selection without displaying the menu
[almost impossible with a linear menu].

The file menu-enhancements.sit.hqx is a lisp package that supports marking
menus. Unlike Gord Kurtenbach's work, the package allows the user to mark
ahead only one level not two or more. The package does, however, support
hierarchical marking menus.

The crucial elements in the code are "marking-menu-views" that support
this type of interaction. The view-click-event-handler ensures that
the user can press the mouse down (click) and then display the menu
(after a pause) or make a selection (immediately) or click again to select.
In addition the system allows you to enable/disable a menu (or menu items),
add/remove menu items, change the menu-font, check/uncheck menu items.

If you want, modify the functions to support floating pop-up menus.

Follow the instructions to see a demonstration of this interaction technique.

mark