Hi guys,
I'd just like to give you some final feedback, how I was able to solve my
problem, drawing a view with some thousand paths in a slow-motion. You all have
contributed to this approach, which is a mixture of your suggestions, and works
pretty well so far.
The basic idea:
1. make the d
Hi Matthias
I got frustrated with my own coding and thought I'd take another crack at your
animation problem as a diversion...
Here's the result, enjoy
-Ken
#define DRAW_LINES_BLOCK_SIZE 100
#define DRAW_LINES_BLOCK_DELAY 1
- (void) setFrame:(NSRect) inRect
{
// I'm assuming you st
Hi Graham, hi Uli,
guys, you're gems! Thanks for all the input. Currently it's too early to dive
into some high sophisticated optimization, and with Graham's info I'm confident
the view's back buffer will work for me.
Am 20. Jun 2011 um 08:59 schrieb Graham Cox :
> The view is already doing th
On 20/06/2011, at 4:47 PM, Matthias Arndt wrote:
> another idea is to cache the last output in a bitmap, redraw it in the next
> iteration, and update the cache after resizing. But I'll look into this only
> if a simple redraw won't be sufficient:
The view is already doing this for you. Every
On 19.06.2011, at 14:46, Matthias Arndt wrote:
> 1. Sleeping the drawing loop in drawRect: (or make the runLoop wait for some
> time) and use [... flushGraphics]: Freezes the GUI, as the app is
> single-threaded
sleep() will block the thread you're in. That's never a good idea (unless the
alte
Hi Graham,
Am 20. Jun 2011 um 02:24 schrieb Graham Cox :
> Your (4) is looking like the best approach - use a timer to schedule a
> periodic update of the view, and during that update, draw only some portion
> of the content on top of what you've drawn already. That leaves the issue of
> view
On 19/06/2011, at 10:46 PM, Matthias Arndt wrote:
> In a document-based app my custom view draws some thousand paths in drawRect:
> with a good performance. Now I'd like to offer a "slow-motion" animation, so
> the user can actually watch the paths being drawn (not each single one, but
> e. g.
Am 19.06.2011 um 19:05 schrieb cocoa-dev-requ...@lists.apple.com:
> If you keep the animation short (say 1.5 to 2 seconds) the freezes might not
> be too irksome to the user [...] CALayer look like an attractive option.
Even with only 0.01 seconds sleep after drawing each path the UI froze
comp
If you keep the animation short (say 1.5 to 2 seconds) the freezes might not be
too irksome to the user, but eliminating them altogether would require adding
NSOperationQueues and NSInvocationOperations to the mix and this is even too
hokey for me :)
With CALayers, you could create 10 different
Hi Ken,
Am 19.06.2011 um 15:40 schrieb Ken Tozier:
> - (void)observeValueForKeyPath:(NSString *) inKeyPath
> ofObject:(id) inObject
> change:(NSDictionary *) inChange
> context:(void *) inContext
> {
> if ([inKeyPath isEqualToString: @"subsetRange"
Have you tried CALayer/CAAnimation? They have a lot of power and are
specifically designed for animation. If for some reason, you don't want to go
that route, the following is a bit hokey, but it might work
Add a "subsetRange" property to your view class
Create a "setSubsetRange:(NSRange) inRan
In a document-based app my custom view draws some thousand paths in drawRect:
with a good performance. Now I'd like to offer a "slow-motion" animation, so
the user can actually watch the paths being drawn (not each single one, but e.
g. in steps of 100 paths per sec).
I though of several approa
Hi all, sorry for a late reply, my e-mail was in moderation queue for
almost a day, but I was able to find an answer in a few hours after I
sent it.
This did the trick for me, all is working well now:
[super setNeedsDisplay:YES]
P.S. This is in Mac OS X.
On 26 Nov 2010, at 17:52, Uli Kust
On Nov 24, 2010, at 6:50 PM, Artemiy Pavlov wrote:
> I have a view whose drawRect method draws a plot according to a few
> parameters which are global variables. When I change these variables
> according to the user input, I want to update that plot, so I need the
> drawRect method of my view to
On Nov 24, 2010, at 9:50 AM, Artemiy Pavlov wrote:
> I have a view whose drawRect method draws a plot according to a few
> parameters which are global variables. When I change these variables
> according to the user input, I want to update that plot, so I need the
> drawRect method of my view
On Nov 24, 2010, at 12:50 PM, Artemiy Pavlov wrote:
> I tried [self setNeedsDisplay] or [MyView setNeedsDisplay] but this doesn't
> work.
Try [self setNeedsDisplay:YES].
--Andy
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not po
Hi all!
I have a view whose drawRect method draws a plot according to a few
parameters which are global variables. When I change these variables
according to the user input, I want to update that plot, so I need the
drawRect method of my view to be called. I tried [self
setNeedsDisplay] o
17 matches
Mail list logo