1 CAPI Reference Entries
define-interface
macro defines subclasses ofinterface
.
define-interface name superclasses slots &rest options
define-interface
is used to define subclasses ofinterface
, which when created withmake-instance
has the specified panes, layouts and menus created automatically. The macro is essentially a version ofdefclass
which accepts the following extra options:
:panes
:layouts
:menus
:menu-bar
:definition
define-interface
.
:panes
,:layouts
and:menus
add extra slots to the class that will contain the CAPI object described in their description. Within the scope of the extra options, the slots themselves are available by referencing the name of the slot, and the interface itself is available with the variablecapi:interface
. Each of the slots can be made to have readers, writers or accessors by passing the appropriatedefclass
keyword as one of the optional arguments in the description.
:panes
option is a list of pane descriptions of the following form
(:panes (slot-name pane-class initargs) ... (slot-name pane-class initargs) )
:layouts
option is a list of layout descriptions of the following form
(:layouts (slot-name layout-class children initargs) ... (slot-name layout-class children initargs) )
:layout
initarg to the interface. If no layouts are specified, then the CAPI will place all of the defined panes into a column layout and make that the primary layout.
:menus
option is a list of menu and menu component descriptions of the following form
(:menus (slot-name title descriptions initargs) ... (slot-name title descriptions initargs) )
:component
, descriptions is a list of menu item descriptions, and initargs is a list of the initialization arguments for the menu. Each item description is either a title, or a list of items containing a title and a list of initialization arguments for the item.
:menu-bar
option is a list of slot names, where each slot referred to contains a menu that should appear on the menu bar.
:definition
option is a property list of arguments whichdefine-interface
uses to change the way that it behaves. Currently there is only one definition option:
:interface-variable
The name of the variable containing the interface.
capi::self
in LispWorks 3.1, and has been kept for compatibility. However, it is recommended that you usecapi:interface
or specify your own name using:interface-variable
.
(capi:define-interface test1 () () (:panes (text capi:text-input-pane)) (:default-initargs :title "Test1"))(capi:display (make-instance 'test1))
(capi:define-interface test2 () () (:panes (text capi:text-input-pane) (buttons capi:button-panel :items '(1 2 3))) (:layouts (main-layout capi:column-layout '(text buttons))) (:default-initargs :title "Test2"))
(capi:display (make-instance 'test2))
(capi:define-interface test3 () () (:menus (color-menu "Colors" (:red :green :blue) :print-function 'string-capitalize)) (:menu-bar color-menu) (:default-initargs :title "Test3"))(capi:display (make-instance 'test3))
(capi:define-interface test4 () () (:menus (color-menu "Colors" ((:component (:red :green :blue) :interaction :single-selection :print-function 'string-capitalize)))) (:menu-bar color-menu) (:default-initargs :title "Test4"))
(capi:display (make-instance 'test4))
capi/elements/graph-pane.lisp
capi/tools/pathname-selector.lisp
interface
layout
menu
Generated with Harlequin WebMaker