• 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: Drawing when app is in active
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing when app is in active


  • Subject: Re: Drawing when app is in active
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 01 Apr 2012 21:47:47 -0700

On Mar 24, 2012, at 3:30 AM, Jonathan Guy wrote:

> If I resize the window it suddenly draws red but deactivating a reactivating the app is not redrawing the view with the correct color. What is going on here?

Activating/deactivating an app does not force all of its views to redraw! That would be really expensive. If you want your view to change appearance when this happens, you'll have to listen for the right notification and call -setNeedsDisplay:. That's what controls that update their appearance when active/inactive do.

Also, you probably don't want the appearance to be based on whether the app is active or inactive; that would be rather weird and nonstandard. Instead, base it on whether the window is key.

—Jens

_______________________________________________

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


  • Prev by Date: Re: crash on OS X when popover closes
  • Next by Date: view-based nstableview advice
  • Previous by thread: Re: Drawing when app is in active
  • Next by thread: Re: Stenography
  • Index(es):
    • Date
    • Thread