Skip to content

Instantly share code, notes, and snippets.

@moratori
Created July 22, 2014 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moratori/b568ef503470aaa1168d to your computer and use it in GitHub Desktop.
Save moratori/b568ef503470aaa1168d to your computer and use it in GitHub Desktop.
clim app5
(in-package :cl-user)
(ql:quickload :clx)
(ql:quickload :mcclim)
(defpackage app
(:use :clim
:clim-lisp))
(in-package :app)
(define-application-frame superapp ()
()
(:pointer-documentation t)
(:panes
(p :application :width 640 :height 240
:display-time t)
(int :interactor :width 640 :height 240))
(:layouts
(default (vertically () p int))))
(define-presentation-type name-of-month ()
:inherit-from 'string)
(define-presentation-type day-of-month ()
:inherit-from 'integer)
(define-superapp-command (com-quit :name t) ()
(frame-exit *application-frame*))
(define-superapp-command (com-out :name t) ()
(with-output-as-presentation (t "The third month" 'name-of-month)
(format t "March~%"))
(with-output-as-presentation (t 15 'day-of-month)
(format t "fifteen~%")))
(define-superapp-command (com-getdate :name t)
((name 'name-of-month) (date 'day-of-month))
(format (frame-standard-input *application-frame*)
"the ~A of ~A~%" date name))
(run-frame-top-level
(make-application-frame 'superapp))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment