Command: pulldown

Syntax

pulldown <file>

or

pulldown {
    <menu_block>
}

Description

Display and select from a pop-up menu pulled down from a button menu bar or other menu.

Parameters

Switches

None

Block

The format of each line within <menu_block> or <file> is as follows:

<num> {,<num> ...} : { <message> } { ,<switches> }
    <command_block>

where:

and the following optional switches:

Notes

The menu will remain displayed until a valid option is picked, or until a click outside the menu is made.

Pulldown menus may be invoked in one of the following situations:

but not from within a macro, stanza or function called from one of the above.

When a command_block invoked by a pulldown menu contains another pulldown menu, that command block must contain only the pulldown command and no others. Any other commands present in the command block will not be executed.

Examples

Attach a pulldown menu to a button of a graphic window. Another pulldown is attached to a menu within the button procedure.

window grawin = wgraphic
grawin.button_labels[2] = 'Zoom/Pan'
grawin.buttons[2] {
   args w=window
   unless (w.view) {
      bell; !Cannot do this on a perspective
   }
   else {
      pulldown {
         1: 'Blow' { blow -iw=w }
         2: 'Shrink' { shrink -iw=w }
         3: 'Pan' {
         # Note: pulldown is the only command in this block
            pulldown {
               1: 'Interactive' { pan -iw=w }
               2: 'Left' { pan -iw=w,-l=0.5 }
               3: 'Right' { pan -iw=w,-r=0.5 }
               4: 'Up' { pan -iw=w,-u=0.5 }
            }
         }
      }
   }
}

See Also

Commands:

choice, hint, string, wpanel

Identifiers:

menu_switch (numeric)

Structures:

menupane, panel, window.buttons