[Openmcl-devel] delegate problems

R. Matthew Emerson rme at clozure.com
Thu Dec 18 21:59:57 UTC 2008


For what it's worth, here's how I'd do it.

(defclass my-delegate (ns:ns-object)
   ()
   (:metaclass ns:+ns-object))

(objc:defmethod  (#/speechSynthesizer:willSpeakWord:ofString: :void)  
((self my-delegate) sender (range #>NSRange) text)
   (declare (ignore sender))
   (format t "~&about to speak word ~s at (~d, ~d)" (#/ 
substringWithRange: text range)
           (pref range #>NSRange.location)
           (pref range #>NSRange.length)))

#|
(defvar *s* (make-instance 'ns:ns-speech-synthesizer))
(#/setDelegate: *s* (make-instance 'my-delegate))
(#/startSpeakingString: *s* #@"Hello Mom.")
|#





More information about the Openmcl-devel mailing list