File 'gui/gPopupMenu.cls' (part of 'Pool_GuiBase')


Home | Packages | Files | Procedures | Classes | Keywords | External packages


Written by
Andreas Kupries
Description
Generic popup menu widget
Keywords
popup, generic popup menu

Class 'genericPopupMenu'

Description
Instances of this class maintains a popup menu
Superclasses
widget
Options
command
Membervariables
entries, entry
Methods
InvokeEntry, addEntries, addEntry, associate, createSubwidgets, entryconfigure, show, showRelative, width

-command
Script to execute upon invocation of a menu entry

entries
Number of entries added so far.
entry
Mapping from symbolic names to menu entries

InvokeEntry (command)

Internal method, called upon invocation of a menu entry.
Argument: commandSymbolic name of the invoked entry.

addEntries (spec)

Adds a bunch of entries to the popup menu.
Argument: specA list suitable for usage with 'array set'. The first item of each pair is the command code to give to the external script (command) upon invocation of the entry. It serves as symbolic name of the entry too. The 2nd item in each pair is the string to display in the entry. A command of '-' indicates a separator line. The display string is ignored in this case, but has to be present nevertheless. A command name has to be unique over all menubuttons added to a menubar.

addEntry (command underline name)

Adds a new menu entry to the popup menu.
Argument: commandSymbolic name of command associated to the entry
Argument: underline (= -1)Index of the character in name to underline.
Argument: name (= {})String to display in the new entry. The special value '-' forces generation of a separator line.

associate (w cmd)

Associate the popup menu with widget w, evaluate cmd upon invokation of a menu entry. The association takes the form of a binding of mouse button 2 causing the display of the menu relative to w.
Argument: wPath to the widget to add the menu to.
Argument: cmdScript to invoke upon activation of a menu entry. Changes command.

createSubwidgets ()

Generate the internal widget. No placement yet, this is done later and explicitly (see show and showRelative)

entryconfigure (command args)

Accessor method allowing the reconfiguration of all entries in the menubar. Access is given based upon the symbolic name of the entry. The mapping to the menu widget of the entry and its index in that is done here.
Argument: commandSymbolic name of the command to operate on.
Argument: argsList of option, value pairs.

show (x y)

Show the popup menu and wait for selection or cancellation.
Argument: xPlace to show the menu at, relative to the rootwindow of the display.
Argument: yPlace to show the menu at, relative to the rootwindow of the display.

showRelative (w x y)

Show the popup menu and wait for selection or cancellation.
Argument: wPath to widget used as root of the coordinates.
Argument: xPlace to show the menu at, relative to widget w.
Argument: yPlace to show the menu at, relative to widget w.

width ()

Returns: Retrieve the width of the menu.


Generated by AutoDoc 2.1 at 02/20/1999, invoked by Andreas Kupries