popup - pulldown command

Jeanne A. E. DeVoto revolution at jaedworks.com
Sat Jun 26 03:15:03 EDT 2004


At 1:24 AM +0200 6/25/2004, Wouter wrote:
>Does someone have a logical explanation why the popup command
>acts on stacks and buttons whereas the pulldown command only
>acts on stacks?

Normally, you access a pulldown menu by clicking the visible menu on 
the screen. But popup menus are usually used as contextual menus - 
they aren't visible before you right-click or control-click, and can 
be popped up anywhere you click.

So there's no need to use the pulldown command to display a simple 
menu. Instead, you just create a button whose menuMode is "pulldown"; 
when the user clicks the button, the menu is displayed. You only need 
to use the pulldown command if you need a stack menu.

But to display a contextual menu, you can't just create a button and 
let the user click the button to show the menu, because the 
contextual menu must be able to respond to a click anywhere in the 
window. You need to display it with the popup command. If the popup 
command didn't act on buttons, you would have to go to the trouble of 
creating a stack menu every time you want to use a contextual menu, 
which is annoying (and also makes it hard to change contextual menus 
on the fly).
-- 
jeanne a. e. devoto ~ jaed at jaedworks.com
http://www.jaedworks.com


More information about the use-livecode mailing list