LispWorks CAPI User Guide > 9 Defining Interface Classes

NextPrevUpTopContentsIndex

9.1 The define-interface macro

The macro define-interface is used to define subclasses of interface , the superclass of all CAPI interface classes.

It is an extension to defclass , which provides the functionality of that macro as well as the specification of the panes, layouts, and menus from which an interface is composed. It takes the same arguments as defclass , and supports the additional options :panes , :layouts , :menus , and :menu-bar .

If you specify :panes but no :layouts , then on creating your interface the CAPI will create a column-layout and arrange the panes in it in the order they are defined. For real applications you will need some control over how the panes are laid out, and this is supplied via the :layouts option.

Each component of the interface is named in the code, and a slot of that name is added to the class created. When an instance of the class is made, each component is created automatically and placed in its slot.

To access a pane, layout or menu in an instance of your interface class you can define an accessor, like viewer-pane in the example below, or simply use with-slots .

When defining a component, you can use other components within the definition simply by giving its name. You can refer to the interface itself by the special name capi:interface .


LispWorks CAPI User Guide (Windows version) - 22 Dec 2009

NextPrevUpTopContentsIndex