On 15/08/2009, at 9:40 AM, bryscomat wrote:

In a window of my app, I have an NSView acting as a toolbar. It is colored with a gradient so that it looks like a textured toolbar and blends in nicely with the title bar. However, it does not fade out when window loses key. I have implemented the delegate method windowDidResignKey: and am attempting to modify it that way. Does anybody have pointers on how to go about this?

In that method, just call -setNeedsDisplay:YES on your view.

In the view's -drawRect: method, detect whether the view's window is currently key, and draw the appropriate background.

To detect whether key, use:

if([self window] == [NSApp keyWindow])
{
        ...

}


--Graham


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to