I am trying to work out using OpenGL in Lush. Specifically, I am
translating example 1.3 of the Red Book to Lush. Basically, this
is just a window with a square in it; when you click the mouse, the
square rotates. The process is driven by an event-timer.
Now, I have this working if I declare the window and then declare
a separate event timer. However, I thought "Wouldn't it be tidier if
the event timer were a slot in the window object?" like the following?
(defclass glut-demo-window glutwindow (spin 0) (inc 0) time cont)
Then, I try to start the timer going using:
(defmethod glut-demo-window start-timer ()
(setq :this:time (new timer 250 10 (lambda(c) (==> this
where spinDisplay performs the rotation.
The problem, of course, is that when the lambda function is executed,
"this" is not defined. Is there a way the event timer can know where
to send it's
message without resorting to a global variable?
Thanks for any guidance or suggestions.
Department of Biostatistics and Applied Mathematics
M. D. Anderson Cancer Center