[Openmcl-devel] How to determine a method's instance to access slot values

Phil pbpublist at comcast.net
Wed May 17 17:53:37 PDT 2006


My general question is how to determine/access an object instance within 
an objective-C method which doesn't pass the instance as a parameter.

Specifically, having sub-classed ns-opengl-view with a slot added to 
track what the opengl view contains, how do I access said slot in the 
draw-rect method?

(defclass my-opengl-view (ns:ns-opengl-view)
   (whichview)
   (:metaclass ns:+ns-object))

(ccl::define-objc-method ((:void :draw-rect (:<NSR>ect a-rect)) 
my-opengl-view)
   ; Cocoa will be calling this method so we'll need to access whichview 
to determine what needs to be redrawn. (slot-value ??? 'whichview)
   )

Thanks,
Phil




More information about the Openmcl-devel mailing list