All Manuals > CAPI User Guide and Reference Manual > 8 Creating Menus

NextPrevUpTopContentsIndex

8.4 Creating individual menu items

The menu-item class lets you create individual menu items. These items can be passed to menu-components or menus via the :items keyword. Using this class, you can assign different callbacks to different menu items.

(setq test (make-instance 'menu-item
                            :title "Test"
                            :callback 'test-callback))
(setq hello (make-instance 'menu-item
                            :title "Hello"
                            :callback 'hello))
(setq group (make-instance 'menu-component
                            :items (list test hello)))
(contain group)

Figure 8.4 Individual menu items

Remember that each instance of a menu item must not be used in more than one place at a time.


CAPI User Guide and Reference Manual (Unix version) - 3 Aug 2017

NextPrevUpTopContentsIndex