LispWorks CAPI User Guide > 8 Creating Menus

NextPrevUpTopContentsIndex

8.5 Mnemonics in menus

On Microsoft Windows and GTK+ you can control the mnemonics in menu titles and menu items using the initargs :mnemonic , :mnemonic-title (and if necessary :mnemonic-escape ).

This example illustrates the various ways you can specify the mnemonics in a menu:

(contain 
 (make-instance
  'menu 
  :mnemonic-title "M&nemonics"
  :items 
  (list
   (make-instance 'menu-item
                  :data "Menu Item 1"
                  :mnemonic #\1)
   (make-instance 'menu-item
                  :data "Menu Item 2"
                  :mnemonic 10)
   (make-instance 'menu-item
                  :mnemonic-title "Menu Item &3")
   (make-instance 'menu-item
                  :mnemonic-title "Menu Item !4"
                  :mnemonic-escape #\!)
   (make-instance 'menu-item
                  :data "Menu Item 5"
                  :mnemonic :default)
   (make-instance 'menu-item
                  :data "Menu Item 6"
                  :mnemonic :none))))

LispWorks CAPI User Guide (Macintosh version) - 22 Dec 2009

NextPrevUpTopContentsIndex