9.2 Defining CLIM Application Frames

9.2.3 Using the :panes and :layouts Options

If the :pane option is not used, a set of named panes can be specified with the :panes option. Optionally, :layouts can also be used to describe different layouts of the set of panes.

The value of the :panes option is an alist, each entry of which is of the form (name . body). name is a symbol that names the pane, and body specifies how to create the pane. body is either a list containing a single element that is itself a list, or a list consisting of a symbol followed by zero or more keyword-value pairs. In the first case, the body is a form exactly like the form used in the :pane option. In the second case, body is a pane abbreviation, where the initial symbol names the type of pane, and the keyword-value pairs are pane options. For gadgets, the pane type is the class name of the abstract gadget (for example, slider or push-button). For CLIM extended stream panes, the following abbreviations are defined:

See Chapter 10, "Panes and Gadgets," for more information on the individual pane and gadget classes and the options they support.

An example of the use of :panes is:

(:panes 
 (buttons
  (horizontally () 
                (make-pane 'push-button :label "Press me") 
                (make-pane 'push-button :label "Squeeze me"))) 
 (toggle toggle-button 
         :label "Toggle me") 
 (interactor :interactor 
             :width 300 :height 300)
 (application :application 
              :display-function 'another-display-function
              :incremental-redisplay t)) 
The value of the :layouts option is an alist, each entry of which is of the form (name . layout). name is a symbol that names the layout, and layout specifies the layout. layout is a form like the form used in the :pane option, with the extension to the syntax such that the name of a named pane can be used wherever a pane may appear. For example, assuming a frame that uses the :panes example, the following layouts could be specified:

(:layouts 
 (default 
   (vertically () 
               button toggle 
               (scrolling () application) 
               interactor)) 
 (alternate
  (vertically () 
              (scrolling () application) 
              (scrolling () interactor) 
              (horizontally ()
                            button toggle)))) 


CLIM 2.0 User's Guide - OCT 1998

Generated with Harlequin WebMaker