2010年8月3日火曜日

McCLIMで升目を描く

formatting-tableを利用すれば良さそうだけど、無理やりな感じが現れてる。

LispworksのCLIMのページを参考にした。

(asdf:oos 'asdf:load-op :mcclim)
;;(asdf:oos 'asdf:load-op :mcclim-truetype)
(in-package :clim-user)

(defun output-table (&key (stream *standard-output*)
inter-row-spacing
inter-column-spacing)
(clim:formatting-table
(stream :x-spacing inter-row-spacing
:y-spacing inter-column-spacing)
(dotimes (i 3)
(clim:formatting-row
(stream)
(dotimes (j 3)
(clim:formatting-cell
(stream)
(clim:draw-rectangle* stream 10 10 50 50 :filled nil)))))))

(define-application-frame formatting-test-frame
()
()
(:menu-bar t)
(:panes
(app-pane :application
:min-width 150
:min-height 150
:scroll-bar t
:display-time :command-loop
:display-function #'(lambda (frame stream)
(output-table :stream stream :inter-row-spacing '(0 :line) :inter-column-spacing '(0 :line))))
)
(:layouts
(default (horizontally () app-pane))))

(define-formatting-test-frame-command (com-quit :menu t) ()
(frame-exit *application-frame*))

;;(run-frame-top-level (make-application-frame 'formatting-test-frame))

0 件のコメント:

コメントを投稿