[Openmcl-devel] NSSlider not responsive

Gary Byers gb at clozure.com
Sat Feb 2 23:16:18 UTC 2008



On Sat, 2 Feb 2008, Osei Poku wrote:

>> 
>> On Sat, 2 Feb 2008, Osei Poku wrote:
>> 
>>> On thing to note is that when I set the target of the slider's action
>>> to be a simple text label using takeFloatValueFrom:, the slider moves
>>> as expected and can be dragged up and down.  Could this be a lisp
>>> callback issue?
>> 
>
> On Feb 2, 2008, at 5:34 PM, Gary Byers wrote:
>
>> What was the slider's target before you made this change ?
>> 
>
> The slider's target was the window-controller/WindowController class using 
> the #/slide: message.
>

It was the class, or an instance of it ?

You defined a #/slide method that would be applicable to any -instance-
of your window-controller class.

The class itself (which in ObjC is an instance of its metaclass; that's
a little different from CLOS, where most classes are instances of
STANDARD-CLASS) doesn't likely respond to #/slide.

If you want the -class- WINDOW-CONTROLLER to respond to #/slide, you
need to define the method on that classe's metaclasss (which in the
bridge would be named +WINDOW-CONTROLLER)

(objc:defmethod (#/slide :void) ((self +window-controller) sender)
   ..)

That method will be applicable to any instance of the metaclass
+WINDOW-CONTROLLER.  There will typically only ever be one
such instance (the class WINDOW-CONTROLLER), and if that class
object is indeed the target if the slider's action, the class
will receive the message.

If having the class wind up as the slider's target was unintentional,
I'd be tempted to blame IB 3.0 (with the caveats that I haven't done
much Cocoa stuff in several months and was never -that- comfortable
with IB 3.0 to begin with.)






More information about the Openmcl-devel mailing list