Re: Pause during drawing
Re: Pause during drawing
- Subject: Re: Pause during drawing
- From: Siegfried <email@hidden>
- Date: Wed, 10 Nov 2010 16:21:06 -0200
On 10/11/2010, at 03:01, Graham Cox wrote:
>
> On 10/11/2010, at 4:23 AM, Siegfried wrote:
>
>> The question is:
>> Is it possible to "pause" after each call…?
>
> Yes, but you need to refactor your code. Just inserting a delay while drawing is a bad idea and won't work.
>
> Set up a timer that calls every 0.25 seconds. Each time the timer fires, increment an ivar that controls which level of triangle is being drawn, and mark the display as needing refresh (-setNeedsDisplay:). Then, in-drawRect:, use the 'current triangle' ivar to do the relevant part of the drawing.
>
> --Graham
>
Thanks Graham, nice approach.
Siegfried
_______________________________________________
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