Created
July 22, 2014 18:31
-
-
Save moratori/b568ef503470aaa1168d to your computer and use it in GitHub Desktop.
clim app5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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