Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Progress bar on front NSPanel is grey not blue??



[This is an old thread, posting for the archives.]

Synopsis: using a NSPanel to show a message and a determinate progress indicator results in the progress bar drawing in grey instead of Aqua.

This happens if the window is not key.

PGM in the original thread had the solution, and it's also touched on in NSWindow's class description:

canBecomeKeyWindow
Returns YES if the receiver can become the key window, NO if it can't.

- (BOOL)canBecomeKeyWindow
Discussion
Attempts to make the receiver the key window are abandoned if this method returns NO. NSWindow's implementation returns YES if the receiver has a title bar or a resize bar, NO otherwise.


Now, my custom panel had a single overridden method:

- (id) initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
{
return [ super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:bufferingType defer:deferCreation];
}


to set the style to borderless, so of course it then cannot normally become key.

What I ended up doing is use a single additional override (alluded to by PGM):

- (BOOL) isKeyWindow
{
  return YES;
}

Once added, the panel now displays an Aqua colored progress bar.

David
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.