NextPrevUpTopContentsIndex

9.2 Defining CLIM Application Frames

define-application-frame [Macro]	

Arguments: name superclasses slots &rest options

Summary: 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:

:pane form , where form specifies the single pane in the application. The default is nil , meaning that there are either no panes or there are multiple panes. This is the simplest way to define a pane hierarchy. The :pane option cannot be used with the :panes and :layouts options. See 9.2.2, Using the :pane Option for a complete description of the :pane option.

:panes form , where form is an alist that specifies names and panes of the application. The default is nil , meaning that there are no named panes. The :panes and :pane options are mutually exclusive. See 9.2.3, Using the :panes and :layouts Options for a complete description of the :panes option.

:layouts form , where form specifies the layout. The default layout is to lay out all of the named panes in horizontal strips. The :layouts and :pane options are mutually exclusive. See 9.2.3, Using the :panes and :layouts Options for a complete description of the :layouts option.

:command-table name-and-options , where name-and-options is a list consisting of the name of the application frame's command table followed by some keyword-value pairs. The keywords can be :inherit-from or :menu (which are as in define-command-table ). The default is to create a command table with the same name as the application frame.

:menu-bar form is used to specify what commands will appear in a "menu bar." It typically specifies the top-level commands of the application. form is either nil , meaning there is no menu bar; t , meaning that the menu from frame's command table (from the :command-table option) should be used; a symbol that names a command table, meaning that that command table's menu should be used. The default is t .

:disabled-commands commands , where commands is a list of command names that are initially disabled in the application frame.

:command-definer value , where value either nil , t , or another symbol. When it is nil , no command-defining macro is defined. When it is t , a command-defining macro is defined, whose name is of the form define-< name >-command . When it is another symbol, the symbol names the command-defining macro. The default is t .

:top-level form , where form is a list whose first element is the name of a function to be called to execute the top-level loop. The function must take at least one argument, the frame. The rest of the list consists of additional arguments to be passed to the function. The default function is default-frame-top-level .

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

make-application-frame [Function]	

Arguments: frame-name &rest options &key pretty-name frame-manager enable state left top right bottom width height save-under frame-class &allow-other-keys

Summary: 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 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*

Summary: 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]	

Arguments: (frame) &body body

Summary: 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


Common Lisp Interface Manager 2.0 User's Guide - 27 Feb 2008

NextPrevUpTopContentsIndex