menu-item-highlighted

Generic Function

Package: common-graphics

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 true if the menu is part of a menu-bar menu hierarchy and nil otherwise.

The default method for menu-bars (pull-down menus) is to pause and then display the help-string as a tooltip just below the menu. This method applies to both the development environment and standalone applications.

The default method for pop-up menus in the development environment is to immediately display the help-string in the Allegro status bar. The default for pop-up menus in a standalone application is to do nothing. To emulate the development environment behavior for pop-up menus in an application's status bar, a method such as the following could be added by an application, where "my-window" is some application window that has a status-bar.

(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 About events in the IDE in cgide.htm.

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.