• 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: DotView.m
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DotView.m


  • Subject: Re: DotView.m
  • From: John Hörnkvist <email@hidden>
  • Date: Wed, 7 Nov 2001 14:19:52 +0100

On Wednesday, November 7, 2001, at 02:01 , Graeme Phillipson wrote:

OK, I got the details wrong! (must remember to double check next time I post) But all the same the point is that the reason you must use setNeedsDisplay rather than calling drawRect directly is that it gives the framework a chance to do some work for you. Like double buffering.

Not double buffering; that's handled at the window level, and happens when you do the drawing, but merging of multiple setNeedsDisplay: and setNeedsDisplayInRect:.

If you really need to do immediate drawing, without going through setNeedsDIsplay:, then you lock focus first;
[view lockFocus];
[view drawRect:someRect];
[view unlockFocus];

For the thrill seekers, you can do interesting things by locking focus on other images or views:
[image lockFocus];
[view drawRect:someRect];
[image unlockFocus];

Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com


References: 
 >Re: DotView.m (From: Graeme Phillipson <email@hidden>)

  • Prev by Date: [Newbie] Current Path
  • Next by Date: Re: DotView.m
  • Previous by thread: Re: DotView.m
  • Next by thread: Re: DotView.m
  • Index(es):
    • Date
    • Thread