Next Prev Up Top Contents Index

menu-component

Class
Summary

The class menu-component is a choice that is used to group menu items and submenus both visually and functionally. The items contained by the menu-component appear separated from other items, menus, or menu components, by separators.

Superclasses

choice
titled-menu-object

Slots

items

The items to appear in the menu.

items-function

A function to dynamically compute the items.

Description

Because menu-component is a choice, the component can be no-selection , single-selection or multiple-selection (extended selection does not apply here). This is represented visually in the menu as appropriate to the window system that the CAPI is running on (by ticks in Microsoft Windows, and by radio buttons and check buttons in Motif). Note that it is not appropriate to have menu components or submenus inside single selection and multiple selection components, but it is in no selection components.

items and items-function behave as in menu.

Example
(capi:contain (make-instance
              'capi:menu-component
              :items '(:red :green :blue)
              :print-function 'string-capitalize
              :interaction :single-selection))
(capi:contain (make-instance
               'capi:menu-component
               :items '(:red :green :blue)
               :print-function 'string-capitalize
               :interaction :multiple-selection))
(capi:contain (make-instance
               'capi:menu
               :items (list
                       "An Item"
                       (make-instance
                        'capi:menu-component
                        :items '(:red :green :blue)
                        :print-function
                         'string-capitalize
                        :interaction :no-selection)
                        "Another Item")))
See also

menu
menu-item


LispWorks CAPI Reference Manual - 14 Dec 2001

Next Prev Up Top Contents Index