Re: continuous slider
Re: continuous slider
- Subject: Re: continuous slider
- From: John Pannell <email@hidden>
- Date: Sun, 11 Jan 2004 12:39:02 -0700
Hi Devon-
In case you would like it, here is the implementation for my subclass
of NSSliderCell that fires off a message after it is done. I had to
override the method below, as was suggested in the thread mmalc
referred to...
@implementation MySliderCell
- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint
inView:(NSView *)controlView mouseIsUp:(BOOL)flag
{
if (flag == YES) {
// mouse just came up
[[self target] sliderIsDoneMoving]; // (your method goes here)
}
[super stopTracking:lastPoint at:stopPoint
inView:controlView mouseIsUp:flag];
}
@end
One bother about the subclassing solution is that I had to then
configure the slider "by hand" instead of using the IB inspectors to do
it. I like your notification solution, but I'm always fearful of
things breaking. Hope this helps!
John
On Jan 11, 2004, at 10:28 AM, Devon E Bowen wrote:
>
> See thread starting
>
> <http://cocoa.mamasam.com/COCOADEV/2003/12/1/78991.php>
>
>
Thanks for the pointer. I think I found a way to do it, though. I set
>
the slider in continous mode and each time the action is called, I
>
send a notification with coalescing turned on. Apparently,
>
notifications
>
are not delivered while the slider is being used. So once the slider
>
is released, the notifications are collapsed into one and then the
>
method of my choice is called. It's a hack and if Apple ever changes
>
it so notifications are delivered during slider use it will break. But
>
it seems to work for now.
>
>
Devon
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.