run-frame-top-level [Generic Function]
Frames
-
are the central abstraction of an application
-
are displayed as top-level window
-
may also be displayed as regions embedded within other applications
-
control the screen real estate managed by an application
-
contain a hierarchy of panes -- from a library of standard panes,
or custom defined panes
-
are managed by special application called a frame manager
-
keep track of Lisp state variables that contain the state of the
application
-
are used to access command-loop, gadgets, and look-and-feel-independence
Panes
-
interactive objects
-
analogous to the windows, gadgets, or widgets of other toolkits
-
layout panes organize space
-
extended stream panes present application-specific information
-
gadget panes display data and obtain user input
Frame Managers
-
control the realization of the look and feel of a frame
-
interpret the specification of the application frame in the context
of the available window system facilities
-
take care of attaching the pane hierarchy of an application frame
to an appropriate place in a window hierarchy
Kinds of Frame Managers
-
desktop manager or window manager
-
allows a user to manipulate the frames of other applications
-
is usually a non-Lisp application
-
acts as a mediator between the Lisp application and the host
desktop manager
-
application acting as frame managers
-
allow frames of other applications to be displayed within the
host application
Constructing Application Frames
Before you can construct an actual instance of an application
frame, you have to name it and define it by calling
define-application-frame (name superclasses slots &rest options)
This is a macro that helps you define a direct sub-class of the class
standard-application-frame
. The &rest options is where
much of the action is because this is where one specifies command
tables, panes for display, and the layout of the panes.
The following code makes and runs a minimal application frame:
(define-application-frame word ;name
() ;superclasses
() ;slots
;; options
(:panes ;panes option
(title ;pane name
:application) ;pane type
(document ;pane name
:application)) ;pane type
(:layouts ;layouts option
(default ;layout name
(vertically () ;layout macros
(1/8 title)
(7/8 document)))))
(run-frame-top-level (make-application-frame 'word :height 300 :width 300))
Exercises
- Load the CLIM package within your Lisp, and switch to the
CLIM-USER package.
- Define, make, and run a minimal CLIM application frame.
- At the toplevel type
(inspect (make-application-frame 'word :height 300 :width 300))
Look for the panes and the command table.
- Macro Expand your call to define-application-frame. Find the
call to defclass.
- Write a utility called make-and-run-frame
that makes and runs an application frame.
Next: CLIM Panes