/[mcclim]/mcclim/Doc/ex3.lisp
ViewVC logotype

Contents of /mcclim/Doc/ex3.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Sat Feb 10 21:32:21 2007 UTC (7 years, 2 months ago) by thenriksen
Branch: MAIN
CVS Tags: McCLIM-0-9-5, McCLIM-0-9-6, HEAD
Changes since 1.1: +4 -2 lines
Made the `string' present method respect the :accept keyword argument,
updated an example program to exploit this.
1 (in-package :common-lisp-user)
2
3 (defpackage :app
4 (:use :clim :clim-lisp)
5 (:export #:app-main))
6
7 (in-package :app)
8
9 (define-application-frame superapp ()
10 ()
11 (:pointer-documentation t)
12 (:panes
13 (app :application :display-time t :height 300 :width 600)
14 (int :interactor :height 200 :width 600))
15 (:layouts
16 (default (vertically () app int))))
17
18 (defun app-main ()
19 (run-frame-top-level (make-application-frame 'superapp)))
20
21 (define-superapp-command (com-quit :name t) ()
22 (frame-exit *application-frame*))
23
24 (define-presentation-type name-of-month ()
25 :inherit-from 'string)
26
27 (define-presentation-type day-of-month ()
28 :inherit-from 'integer)
29
30 (define-superapp-command (com-out :name t) ()
31 (with-output-as-presentation (t "The third month" 'name-of-month)
32 (format t "March~%"))
33 (with-output-as-presentation (t 15 'day-of-month)
34 (format t "fifteen~%")))
35
36 (define-superapp-command (com-get-date :name t)
37 ((name 'name-of-month) (date 'day-of-month))
38 (format (frame-standard-input *application-frame*)
39 "the ~a of ~a~%" date name))

  ViewVC Help
Powered by ViewVC 1.1.5