• 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: -setNeedsDisplay: different between Tiger and Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -setNeedsDisplay: different between Tiger and Leopard


  • Subject: Re: -setNeedsDisplay: different between Tiger and Leopard
  • From: glenn andreas <email@hidden>
  • Date: Fri, 14 Dec 2007 12:29:44 -0600


On Dec 14, 2007, at 12:13 PM, John Stiles wrote:

I am writing code that moves a control from one place to another. In Leopard, this works great:

[control setNeedsDisplay:YES]; // clean up at old location
[control setFrame:newFrame]; // move control
[control setNeedsDisplay:YES]; // redraw at new location

However, in Tiger, this doesn't work properly; the control is not erased from its old location. It behaves as if the first - setNeedsDisplay: was not called at all. (And in fact, on Leopard, if you remove the first -setNeedsDisplay:, you get the same artifacts.)

What's the simplest way to fix this on all OSes?


Just a guess, but how about:

[[control superview] setNeedsDisplay: YES];
[control setFrame: newFrame];
[control setNeedsDisplay: YES];

(ideally, setNeedsDisplayInRect should probably be called instead to limit what the superview redraws)

Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | prime : build, mutate, evolve, animate : the next generation of fractal art




_______________________________________________

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


  • Follow-Ups:
    • Re: -setNeedsDisplay: different between Tiger and Leopard
      • From: John Stiles <email@hidden>
References: 
 >-setNeedsDisplay: different between Tiger and Leopard (From: John Stiles <email@hidden>)

  • Prev by Date: Re: -setNeedsDisplay: different between Tiger and Leopard
  • Next by Date: Re: printf
  • Previous by thread: Re: -setNeedsDisplay: different between Tiger and Leopard
  • Next by thread: Re: -setNeedsDisplay: different between Tiger and Leopard
  • Index(es):
    • Date
    • Thread