Scrolling Menu

Richard Gaskin ambassador at
Tue Mar 21 14:19:29 EDT 2017

dunbarx wrote:

 > So I made a stack that had a group of a dozen buttons piled up
 > vertically.
 > Now I make the stack a stack menu. The issue with a stack menu is
 > that very few messages are sent at all, but "mouseDown" is one that
 > is. The stack remains nice and still but the group scrolls smoothly,
 > up or down depending on where you click vertically. Not rocket
 > science.
 > The stack itself really believes it is a menu style button, even
 > containing a phantom "menuPick" handler for convenience.

Using buttons on a stack as menu items dates back to the very earliest 
days of MetaCard, when the only supported UI was Motif.  The various 
settings available for buttons in support of that role (e.g. "cascade" 
menustyle) are great for Motif - but not to much for anything else.

Thankfully, in the late '90s the engine evolved to include support for 
menus as textual lists, which most of us use today.

Stack menus might be candidates for deprecation were it not for one 
thing they continue to do well:  if you need a graphical menu, such as a 
gallery picker, the remain an excellent solution.

As one expects with menu items, the full scope of event messages we get 
for buttons used in more conventional contexts have no purpose when used 
as a menu.  MouseDown triggers the selection which closes the menu 
stack, and menuPick is generated as it is with modern textual buttons to 
allow handlers to respond to menu selection.

This part was interesting to me, since I've not been able to get 
scrolling happening at all:

 > Now this a real kluge, in that the stack is not scrolling, but rather
 > the controls are, and in the "opposite" direction.

Can you describe that in more detail? How do you know the content region 
of the stack isn't scrolling if all of the objects contained within it 
are scrolling?

If you see anything different than what's reported here it may be 
helpful to add a note to this report, and please include your OS and LC 

 > This surely can be enhanced to show a scrollbar to emulate a scroll
 > button at the stack level. All the properties of the button, stack
 > and group are accessible; there should be no reason that one could
 > not make a "scrolling stack"

We could, but you'll find that once you mouse down on the scrollbar the 
menu is dismissed.  This would be an undesirable behavior for any normal 
stack, but it's exactly what one wants for menus, which don't normally 
have scrollbars.

I needed a middle ground a while back when designing Devo 4, where I 
wanted controls to appear temporarily similar to how a menu provides 
them, but I also wanted the ability of interacting with them more akin 
to a normal stack.

The result is what I call a "flyout pane", and you'll find examples in 
the Devo 4 plugin available for free at my site:

  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  Ambassador at      

More information about the use-livecode mailing list