small medium large xlarge

24 May 2009, 20:02
Stéphane (1 post)

I have a custom nsview which draw his background with drawrect (and a gradient) and CALayers to draw other part of the UI

I put it in an NSWindow with want core animation layer set to yes for the contentview and each custom view.

I am trying to draw the gradient background with a blue color when the window is the key window and with a black color if not.

Is there any reason for the nswindow to return NO to [[self window] isKeyWindow] in the custom view because of core animation or the layers ?? (the NSWindow return NO event if there is only one window opened)

25 May 2009, 09:17
Bill Dudney (916 posts)

I’d have to know more to be able to tell for sure. But did you seen makeKeyAndOrderFront to the window?

I can think of no reason for CoreAnimation to have any effect on the window’s key status.

Good luck and let us know what you find.

You must be logged in to comment