All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

NextPrevUpTopContentsIndex

display-popup-menu

Function
Summary

Displays a popup menu.

Package

capi

Signature

display-popup-menu menu &key owner x y button => result

Arguments

menu

A menu.

owner

A pane.

x

The horizontal coordinate of menu 's position relative to owner .

y

The vertical coordinate of menu 's position relative to owner .

button

The mouse button that raises the menu.

Description

The function display-popup-menu displays the menu menu at position x , y . display-popup-menu should be used in response to the user clicking a mouse button, and is typically used to implement context ("right button") menus.

The user may select an item in the menu, in which case the item's selection-callback is invoked, and display-popup-menu returns t .

Alternatively the user may cancel the menu, by clicking elsewhere or pressing the Escape key. In this case, display-popup-menu returns nil.

owner specifies the owner of the menu, that is, a pane that the menu is associated with. If owner is not supplied the system tries to find the appropriate owner, which usually suffices.

x and y default to the horizontal and vertical coordinates, relative to owner, of the location of the mouse pointer.

button defaults to :button-3.

Example

See Displaying menus programmatically.

See also

menu
pinboard-layout
popup-menu-force-popdown
Displaying menus programmatically


CAPI User Guide and Reference Manual (Unix version) - 3 Aug 2017

NextPrevUpTopContentsIndex