[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sample CLIM code
Hi,
I am trying to run the following sample code from page 212-213 of
the CLIM Release 1.0 manual:
(clim:define-application-frame asset ()
((pathname :initform #p"foo")
(integer :initform 10)
(member :initform :one))
(:panes ((avv :accept-values
:display-function '(clim:accept-values-pane-displayer
:displayer display-avv))
(display :application
:display-function 'draw-display
:display-after-commands :no-clear)))
(:command-table (asset :inherit-from (clim:accept-values-pane))))
(defmethod draw-display ((frame asset) stream)
(with-slots (pathname integer member) frame
(fresh-line stream)
(clim:present (path frame) 'pathname :stream stream)
(write-string ", " stream)
(clim:present (int frame) 'integer :stream stream)
(write-string ", " stream)
(clim:present (mem frame) '(member :one :two :three) :stream stream)
(write-string ", " stream)))
(defmethod display-avv ((frame asset) stream)
(with-slots (pathname integer member) frame
(fresh-line stream)
(setq pathname (clim:accept 'pathname
:prompt "A pathname" :default pathname
:stream stream))
(fresh-line stream)
(setq integer (clim:accept 'integer
:prompt "A integer" :default integet
:stream stream))
(fresh-line stream)
(setq member (clim:accept '(member :one :two :three)
:prompt "One, Two, or Three" :default member
:stream stream))
(fresh-line stream)
(clim:accept-values-command-button (stream :documentation "You wolf")
(write-string "Wolf whistle" stream)
(beep))))
(defun run-asset (root)
(let ((asset (clim:make-application-frame 'asset
:parent root :width 400 :height 400)))
(clim:run-frame-top-level asset)))
******************
In order to run the code I do:
user(3): (setq *root* (clim:open-root-window :clx))
user(4): (run-asset *root*)
Error: The slot clos::prototype is missing from the object #<structure-class pathname @ #x6fac86> of class #<standard-class structure-class @ #x61dffe> during operation slot-value
[condition type: program-error]
Restart actions (select using :continue):
0: Try accessing the slot again
1: Return a value
[1] user(5):
Whats wrong here? Seems like a simple example?
Thanks in advance,
Chuck
----------------------------------------------------------------------------
| Charles P. Lombardo | lombardo@cs.nps.navy.mil |
| Computer Science Department | voice: 408-646-2102 |
| Naval Postgraduate School | fax: 408-646-2814 |
----------------------------------------------------------------------------