• 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: How to flash two rectangles in a frame?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to flash two rectangles in a frame?


  • Subject: Re: How to flash two rectangles in a frame?
  • From: Kyle Sluder <email@hidden>
  • Date: Sun, 15 Mar 2009 17:20:30 -0400

On Sun, Mar 15, 2009 at 4:53 PM, Philip Kime <email@hidden> wrote:
> With a minor change, this worked perfectly - many thanks to both people who
> responded. I am simply unaware of a lot of the API here so hadn't looked at
> these functions.

It's worth noting that you're going about this problem a bit
backwards.  Typically, one maintains the view's state separate from
its actual window buffer, using this state information inside of
-drawRect:.  Relying on your window's backing store to remain
unchanged so that you can reverse the effects of your previous drawing
is perilous, since any code at any time can call -lockFocus on your
view/window and doodle all over your previous drawing.  In fact, this
is precisely what the focus ring does.

Your best bet is to instead store a flag and use that flag's value to
change how you draw inside -drawRect:.  Use -setNeedsDisplayInRect: to
tell your view to redraw.

--Kyle Sluder
_______________________________________________

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

References: 
 >How to flash two rectangles in a frame? (From: Philip Kime <email@hidden>)
 >Re: How to flash two rectangles in a frame? (From: Graham Cox <email@hidden>)
 >Re: How to flash two rectangles in a frame? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: How to flash two rectangles in a frame? (From: Philip Kime <email@hidden>)

  • Prev by Date: Re: How to flash two rectangles in a frame?
  • Next by Date: Re: Performance problem with GC enabled
  • Previous by thread: Re: How to flash two rectangles in a frame?
  • Next by thread: PDFView drag and drop
  • Index(es):
    • Date
    • Thread