Re: Continuous controls: detecting when the last message comes through
Re: Continuous controls: detecting when the last message comes through
- Subject: Re: Continuous controls: detecting when the last message comes through
- From: Jean-François Veillette <email@hidden>
- Date: Wed, 11 Jul 2001 12:12:00 -0400
A side effects of those slider is that they hold on the event loop, they
loop in a 'while()' to check for mouse events and move the slider
accordingly.
In my case, the slider was modifying the model, and the model was
posting notification about it's changes.
- (void)update:(NSNotification*)notification
{
if([window isVisible])
{
[NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(print:)
object:nil];
[self performSelector:@selector(generate:)
withObject:nil
afterDelay:0.1];
}
}
This will actualy do the generate: method at the next event-loop. when
the slider is finished with it's things.
- jfv
Le Mercredi 11 juillet 2001, ` 11:24, Phil Barrett a icrit :
Is there a way to tell if the action sent by a continuous control
(e.g. a
slider or scroller) is the final one, caused by the mouse-up?
While the user is dragging the slider back and forth, I want to do quick
updates to give feedback, but I need to know when the mouse is released
and
I get a final action, so I can do a slower update of the information.
Maybe it's as simple as asking if the mouse button is down when the
action
is received - but what's the easiest way to do that? I'm already
watching
the events coming through [NSApplication sendEvent:] but this only sees
the
mouse down that started the drag, so I can't check there.
Or is there a way to ask an NSCell it it's currently tracking the mouse?
Thanks
Phil
--
Phil Barrett - CTO - Cambridge Animation Systems
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev