Re: Wheel Start and End
Re: Wheel Start and End
- Subject: Re: Wheel Start and End
- From: Lorenzo <email@hidden>
- Date: Fri, 13 Jul 2007 21:27:18 +0200
Hi arri,
in the meantime I implemented that and it works like a charm.
I set a 0.1 interval timer.
As far as the mouseDragged, I use to set up some variable therein and not in
mouseDown because in case of mouseDragged my settings are different than in
mouseDown. Also I have seen this technique in many other code. I presume
that if you don't go into the loop, the mouseDragged method should be
invoked all the time. Instead with this method you get it only once.
Also, this way you can avoid to create many method variables in your class,
which you must set into mouseDown and use from within mouseDragged.
Best Regards
--
Lorenzo
email: email@hidden
> From: arri <email@hidden>
> Date: Fri, 13 Jul 2007 20:23:45 +0200
> To: Lorenzo <email@hidden>
> Cc: email@hidden
> Subject: Re: Wheel Start and End
>
>> Does it sound a good idea?
>
> sounds like a fine idea to me..
>
> i'm using a simiar approach for stuff that need to happen each time a
> custom view is resized, but NOT each time -windowDidResize is fired..
> to make the resizing more fluid.
>
>
> just curious;
> why hang yourself in a loop, while you could also just do the initial
> setting-up in 'mouseDown', the funky stuff in 'mouseDragged', and
> your final bits in 'mouseUp' ?
>
> hogging the eventloop sounds like a not so good idea to me..
>
> .a
>
> On Jul 13, 2007, at 3:47 PM, Lorenzo wrote:
>
>> As you know it's easy to detect when a mouseDragged event occurs,
>> so you can
>> firstly set some variable then go into your own loop, then set some
>> variable
>> after the drag ends.
>>
>> - (void)mouseDragged:(NSEvent*)theEvent
>> {
>> // do some settings here
>>
>> while(isOnDragging){
>> theEvent = [[self window] nextEventMatchingMask:eventMask];
>> ... // if mouseUp break;
>> }
>> // end of drag, so other settings here
>> }
>>
>> Now, I would like to do the same with the scrollWheel.
>> But I have just an API
>> - (void)scrollWheel:(NSEvent*)theEvent
>> and not so many ideas about how to do it. I though to put a timer
>> to check
>> whether the elapsed time after the last scrollWheel event is more
>> than e.g.
>> 0.5 seconds. If so, I can call the "endOfScrollWheel" event and set
>> some
>> variables too. Does it sound a good idea?
>>
>>
>> Best Regards
>> --
>> Lorenzo
>> email: email@hidden
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>>
>> -----
>> Scanned for virus and spam
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden