[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rank novice question

>To: info-mcl
>From: pts@faraday.clas.Virginia.EDU (Paul T. Shannon)
>Newsgroups: comp.lang.lisp.mcl
>Subject: rank novice question
>Organization: University of Virginia
>In one of my first efforts using mcl, I get completely stumped
>on this problem:
>(in-package :ccl)
>#<Package "CCL">
>(setq w (make-instance 'window)
>#<WINDOW "Untitled" #x69FB1>
>? (line-to w 5 5)
>> Error: Undefined function LINE-TO called with arguments (#<WINDOW
>  "Untitled" #x69F6B1> 5 5)
>   etc.
>I get the same error evaluating from either the Listener or a fred
>I'm sure I'm missing something simple here.  Suggestions welcom.
> - Paul Shannon
>   pts@Virginia.edu
It looks like you're missing the (require 'quickdraw) line, which
loads in some stuff from library:QuickDraw.lisp.

Try this out for size, and also look in the "examples" folder
for some more code to steal ideas from.

(in-package :ccl)

(require 'quickdraw)

(defclass my-window (window) nil)
(defvar *my-window* (make-instance 'my-window :window-title "My Window"))

; This method gets called automatically by the system
; whenever the window needs to be refreshed.
(defmethod view-draw-contents ((view my-window))
  (let ((top-left #@(10 10))
        (bot-right #@(100 50)))
    (with-focused-view view
      (set-pen-size view 1 1)
      (move-to view top-left)
      (line-to view bot-right)
      (set-pen-size view 8 2)
      (frame-oval view top-left bot-right))))

; (view-draw-contents *my-window*)