All Manuals > CAPI User Guide > 9 Creating Menus

NextPrevUpTopContentsIndex

9.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))))

On Microsoft Windows you may need to press Alt to make the underlines appear.


CAPI User Guide (Windows version) - 30 Aug 2011

NextPrevUpTopContentsIndex