Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version


Arguments: menu menu-item-or-item-number window-or-screen

Called to process a menu-item that was chosen by the end user (either by clicking on it or first selecting it and then pressing the main Enter key).

The default method first checks to see if the value of the chosen menu-item is another menu. If so, it calls pop-up-menu on that menu. Otherwise it funcall's the value of the on-click property of the menu, passing three arguments:

  1. the menu that was passed to this function
  2. the chosen menu-item
  3. the stream that was passed to this function, which is either a window or the screen

menu is the menu that contains the chosen menu-item.

menu-item-or-item-number is either the menu-item that was chosen, or the index of the item within the menu-items of the menu, where zero indicates the topmost menu-item.

window-or-screen is either the window on which the menu was invoked with pop-up-menu, or else the window on which the menu was defined or the screen.

The default handle-menu-selection method should suffice for most applications, since menus are typically customized by a combination of menu-item values and (when needed) custom on-click event handlers.

But an application could replace the default handle-menu-selection method with one that bypasses the on-click functionality entirely. Or an application could add handle-menu-selection wrapper methods that catch every menu choice for some class of menu.

See cg-events.htm for information about event handling in Common Graphics.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version