All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

define-menu Macro

Summary

Defines a menu function.

Package

capi

Signature

define-menu function-name (self) title descriptions &rest initargs

Arguments
function-name
A symbol.
self
A symbol.
title
A string.
descriptions
Lisp forms describing menu items.
initargs
Keywords and values.
Description

The macro define-menu defines a function called function-name with a single argument self that will make a menu from title, descriptions and initargs, which take the same form as the :menus section of define-interface.

Examples
(capi:define-menu make-test-menu (self)
   "Test"
   ("Item1"
    "Item2"
    (:component
     ("Item3"
      "Item4")
     :interaction :single-selection)
    (:menu
     ("Item5" 
      "Item6")
     :title "More Items")))
 
(setq interface (make-instance 'capi:interface))
 
(setf (capi:interface-menu-bar-items interface)
      (list (make-test-menu interface)))
 
(capi:display interface)
See also

define-interface
menu
undefine-menu


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42