Application Frames

part of Common Lisp Interface Manager (CLIM) by Jason Kantz

Questions

  • What are the characteristics and components of application frames?
  • How are application frames defined and constructed?
  • How are application frames displayed?

    Reading

  • define-application-frame [Macro]
  • make-application-frame [Function]
  • run-frame-top-level [Generic Function]

    Frames

    Panes

    Frame Managers

    Kinds of Frame Managers

    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

    1. Load the CLIM package within your Lisp, and switch to the CLIM-USER package.
    2. Define, make, and run a minimal CLIM application frame.
    3. At the toplevel type
      (inspect (make-application-frame 'word :height 300 :width 300))
      Look for the panes and the command table.
    4. Macro Expand your call to define-application-frame. Find the call to defclass.
    5. Write a utility called make-and-run-frame that makes and runs an application frame.

    Next: CLIM Panes