• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Changing subviews during drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Changing subviews during drawing
      • From: j o a r <email@hidden>
References: 
 >Changing subviews during drawing (From: Drew McCormack <email@hidden>)
 >Re: Changing subviews during drawing (From: j o a r <email@hidden>)

  • Prev by Date: Re: Distributed Objects pitfalls and strategies (SOLUTION (?))
  • Next by Date: Re: Changing subviews during drawing
  • Previous by thread: Re: Changing subviews during drawing
  • Next by thread: Re: Changing subviews during drawing
  • Index(es):
    • Date
    • Thread