-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframework-examples.lisp
More file actions
47 lines (35 loc) · 1.55 KB
/
framework-examples.lisp
File metadata and controls
47 lines (35 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
;;; Fri Feb 26 00:57:46 1993 by Mark Kantrowitz <mkant@GLINDA.OZ.CS.CMU.EDU>
;;; framework-examples.lisp -- 1477 bytes
;;; ****************************************************************
;;; FrameWork Examples *********************************************
;;; ****************************************************************
;;; This file contains a few examples of using FrameWork. The examples
;;; were written by Nick Afshartous <nick@dmi.stevens-tech.edu> or
;;; <afshar@cs.nyu.edu>.
(eval-when (compile load eval)
(unless (find :framework *features*)
(warn "FrameWork must be loaded before using this file.")))
;;; Some defclass examples
;;; Special symbols like if-needed, if-added, value must be keywords to
;;; avoid package problems. This is also true in (init, before, and after)
;;; method definitions.
(fw:defclass pane ()
(pane-slot
(:IF-NEEDED (format t "~&if-needed daemon"))))
(fw:defclass door (pane)
(door-size
(:IF-ADDED (format t "~&if-added daemon------------------"))
(:IF-NEEDED (format t "~&if-needed daemon------------------")))
(fred
(:IF-ADDED (fw:send fw:%frame :init))))
(fw:defmethod (:init door :before) ()
(format t "~&in :BEFORE method, self = ~a" fw:%frame))
(fw:defmethod (:init door) ()
(format t "~&in primary method"))
(fw:defmethod (:init door :after) ()
(format t "~&in :AFTER method"))
;;; execute :if-needed demon
(fw:frameget 'door 'door-size :value nil)
;;; execute methods via :if-added demon
(fw:frameput 'door 'fred :value 5)
;;; *EOF*