Re: Drawing when app is in active
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