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

menu-item-highlighted

Arguments: window menu menu-item menu-bar-p

This generic function is called each time a menu-item is highlighted as the user moves the mouse over the items of any menu. Methods may be added to this generic function to customize how an application shows the help-strings of menu-items to the end user.

window is the parent window of the menu, menu is the menu that the menu-item is on, menu-item is the menu-item itself, and menu-bar-p is a boolean, true if the menu is part of a menu-bar menu hierarchy and nil otherwise.

The built-in methods display the help-string of the highlighted menu-item in the status bar of the window that the menu is on, if it has a status bar. For a pop-up-menu, this is the window that was passed as the stream argument to the function pop-up-menu, if any.

Below is a sample method that is similar to the built-in methods; a custom method could be modeled after this one. Note that this method would be called for pop-up menus only, since it specializes on menu-bar-p being nil.

(defmethod menu-item-highlighted ((window my-window-class)
                                (menu menu)
                                (menu-item menu-item)
                                (menu-bar-p (eql nil)))
   (let* ((string (help-string menu-item)))
      (when string
         (window-message my-window "~a" string))))

See also show-help-strings-as-tooltips, which provides for help strings being displayed as tooltips. 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.

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