1 CAPI Reference Entries
interface
is the top level window class, which contains both menus and a hierarchy of panes and layouts. Interfaces can also themselves be contained within a layout, in which case they appear without their menu bar.
simple-pane
titled-pane
title
layout
menu-bar-items
The items on the menu bar.
destroy-callback
A callback done on closing the window.
confirm-destroy-function
A function to verify closing of the window.
best-x
best-y
best-width
best-height
interface-title
pane-layout
interface-menu-bar-items
interface-destroy-callback
interface-confirm-destroy-function
titled-pane
for more details).
layout
specifies a layout object that contains the children of the interface. To change this layout you can either use the writerpane-layout
, or you can use the layoutswitchable-layout
which allows you to easily switch the currently visible child.
menu-bar-items
specifies a list of menus to appear on the interface's menu bar. Note that an interface may have some automatic menus created by the environment in which it is running (for example the Works menu in the LispWorks environment). To switch these automatic menus off, specify the argument
:auto-menus nil
display
anddisplay-dialog
. Then to remove it from the display again, you usequit-interface
and eitherexit-dialog
orabort-dialog
respectively. When the interface is about to be closed, the CAPI calls theconfirm-destroy-function
(if there is one) with the interface, and if this function returns non-nil
the interface is closed. Once the interface is closed, thedestroy-callback
is called with the interface.
best-x
andbest-y
must be the position as an integer ornil
(meaning anywhere), while the argumentsbest-width
andbest-height
can be any hints accepted bymax-width
andmax-height
for elements.
(capi:display (make-instance 'capi:interface :title "Test Interface"))(capi:display (make-instance 'capi:interface :title "Test Interface" :destroy-callback #'(lambda (interface) (capi:display-message "Quitting ~S" interface))))
(capi:display (make-instance 'capi:interface :title "Test Interface" :confirm-destroy-function #'(lambda (interface) (capi:confirm-yes-or-no "Really quit ~S" interface))))
(capi:display (make-instance 'capi:interface :menu-bar-items (list (make-instance 'capi:menu :title "Menu" :items '(1 2 3))) :title "Menu Test"))
(setq interface (capi:display (make-instance 'capi:interface :title "Test Interface" :layout (make-instance 'capi:simple-layout :description (make-instance 'capi:text-input-pane) ))))
(setf (capi:pane-layout interface) (make-instance 'capi:simple-layout :description (make-instance 'capi:editor-pane)))
(capi:display (make-instance 'capi:interface :title "Test" :best-x 200 :best-y 200 :best-width '(/ :screen-width 2) :best-height 300))
layout
switchable-layout
menu
display
display-dialog
quit-interface
define-interface
activate-pane
Generated with Harlequin WebMaker