Chapter 9 Defining Application Frames

9.2 Defining CLIM Application Frames

define-application-frame [Macro]
name superclasses slots&rest options
Defines a frame and CLOS class named by the symbol name that inherits from superclasses and has state variables specified by slots. superclasses is a list of superclasses that the new class will inherit from (as in defclass). When superclasses is nil, it behaves as though a superclass of standard-application-frame was supplied. slots is a list of additional slot specifiers, whose syntax is the same as the slot specifiers in defclass. Each instance of the frame will have slots as specified by these slot specifiers. These slots will typically hold any per-instance frame state.

options is a list of defclass-style options, and can include the usual defclass options, plus any of the following:

The name, superclasses, and slots arguments are not evaluated. The values of each of the options are evaluated.

make-application-frame [Function]
frame-name&rest options&key pretty-name frame-manager enable state left top right bottom width height save-under frame-class&allow-other-keys
Makes an instance of the application frame of type frame-class. If frame-class is not supplied, it defaults to frame-name.

The size options left, top, right, bottom, width, and height can be used to specify the size of the frame.

options are passed as additional arguments to make-instance, after the pretty-name, frame-manager, enable, state, save-under, frame-class, and size options have been removed.

If save-under is t, then the sheets used to implement the user interface of the frame will have the "save under" property, if the host window system supports it.

If frame-manager is provided, then the frame is adopted by the specified frame manager. If the frame is adopted and either enable or state is provided, the frame is pushed into the given state. See Section 9.9, "Frame Managers."

Once a frame has been created, run-frame-top-level can be called to make the frame visible and run its top-level function.

*application-frame* [Variable]
The current application frame. The global value is CLIM's default application, which serves only as a repository for whatever internal state is needed by CLIM to operate properly. This variable is typically used in the bodies of commands to gain access to the state variables of the application frame, usually in conjunction with with-slots or slot-value.

with-application-frame [Macro]
(frame)&body body
This macro provides lexical access to the "current" frame for use with the :pane, :panes, and :layouts options. frame is bound to the current frame within the context of one of those options.

frame is a symbol; it is not evaluated. body may have zero or more declarations as its first forms.

9.2.1 - The Application Frame Protocol
9.2.2 - Using the :pane Option
9.2.3 - Using the :panes and :layouts Options
9.2.4 - Example of the :pane Option to define-application-frame
9.2.5 - Examples of the :panes and :layout Options to define-application-frame
9.2.6 - Using an :accept-values Pane in a CLIM Application Frame

CLIM 2.0 User's Guide - OCT 1998

Generated with Harlequin WebMaker