Chapter 1 Using CLIM
> (load "<release directory>/template.lisp")
Next, type the following at the Lisp prompt:To exit the application and return to the Lisp top level, left-click on the Exit menu item. Type> (run-frame-top-level
(make-application-frame 'test :width 400 :height 500))
(LCL:QUIT)
to quit Lisp.To keep the User's Guide concise, many of the examples in it are simply code segments. To try them out in Liquid Common Lisp, you need some supporting CLIM code that defines an application frame. The file loaded previously is one such template. It contains the following code:
(in-package :clim-user) (define-application-frame test () ((height :initform 55 :accessor height)) (:panes (main :application :display-function 'display-main) (prompter :interactor)) (:layouts (:default (vertically () (2/3 (bordering () main)) (1/3 prompter))))) (defmethod display-main ((frame test) stream) (let ((x 55) (y 55) (width 55)) (draw-rectangle* stream x y (+ x width) (+ y (height frame)) :ink +red+))) (define-test-command (com-exit :menu "Exit" :name t) () (frame-exit *application-frame*)) (define-test-command (com-test :menu "Test" :name t) ((new-height 'integer :default (height *application-frame*))) "Changes the default value of the height slot." (setf (height *application-frame*) new-height))
Generated with Harlequin WebMaker