2.2 Displaying bitmaps on the screen
The function make-window
creates and returns a window of the specified dimensions:
(setq *window* (make-window :inside-width 100 :inside-height 100 :title "My Window"))There is now a cleared window with borders and a title on the screen. Since a window creates an associated bitmap by default, you can perform graphics operations directly to the window's bitmap by using the variable that contains the window in place of the bitmap argument of output functions:
(draw-circle *window* (make-position 50 50) 30 :width 30)Notice that the width equals the radius of the circle in the previous example, so a solid circle is drawn in the middle of the window.
Since all windows are created with associated bitmap output streams, you can also format text directly onto the window:
(format *window* "Hello Lisp World!")You can now change the window's output stream position so that the Common Lisp function
format
outputs to another location:(setf (stream-position *window*) (make-position 10 50)) (format *window* "Here I am.")
Generated with Harlequin WebMaker