Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Moderately revised from 8.1.
8.1 version

proxy-menu-bar-window

Arguments: window

Returns the window whose menu-bar will be searched when a keypress event occurs in the argument window. If a menu-item is found whose event-synonym matches the keypress event, then this menu-item is invoked instead of calling virtual-key-down as usual. Menu accessors such as Alt-F to show the File menu are also redirected according to this generic function.

Applications should not call this function, but it may be useful to add methods to it when the default method does not allow keyboard shortcuts to access the desired menu-bar. The default method returns the window itself if it has a menu-bar, and otherwise its owner if it has a menu-bar, and so on up through the top-level owner window; if no menu-bar is found, the top-level owner window is returned.

If an application has one top-level window that should be able to access a second top-level window's menu-bar, and the second window is not the owner of the first, then it may be useful to write a proxy-menu-bar-window method on the class of the first window that returns the second window. This is how the IDE allows its various top-level windows to access the single IDE menu-bar via keyboard shortcuts.

It is still the responsibility of the menu-bar commands to direct their functionality to the appropriate window. This can be done in a handle-menu-selection method or (more typically) in the on-click function of particular menus.

GTK note: This feature would work on the GTK platform only if the override-native-shortcuts property of each pull-down menu on the menu bar is set to true.

See cg-events.htm for information about event handling in Common Graphics and see event-synonym, handle-menu-selection, and on-click.


Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page has had moderate revisions compared to the 8.1 page.
Created 2016.6.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Moderately revised from 8.1.
8.1 version