Re: Changing subviews during drawing
Re: Changing subviews during drawing
- Subject: Re: Changing subviews during drawing
- From: Drew McCormack <email@hidden>
- Date: Wed, 31 Mar 2004 11:16:52 +0200
On Mar 30, 2004, at 8:22 PM, j o a r wrote:
I assume that the attributes of the plot doesn't change *during*
drawRect, so why is this a problem? When the attribues change,
presumably from some user action, do what you have to do with the
subviews, and then call "setNeedsDisplay:" (or if you really, really,
really, have to; "display"). Something like this:
- (void) changeAttributeToSomePhoneyValue:(int) theNewValue
{
theValue = theNewValue;
[self setSubviewsBasedOnNewValue];
[myView setNeedsDisplay: YES];
}
Hi Joar,
I guess this is a solution, but sort of defeats the purpose of making
the changes 'lazily'. The thing is, there may be lots of attributes
set, and you don't really want to re-layout the plot (eg setup axes
etc) until you need to, otherwise you have to do it every time
something changes, which is wasteful.
One solution would be to make the user of the class explicitly call
the 'layout' method when they have changed the attributes. This is not
a bad solution, but I can't help thinking this is something which
should happen automatically, and only when a redraw is required.
Drew
_______________________________________________
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.