• 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: Progress bar on front NSPanel is grey not blue??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: RE: Progress bar on front NSPanel is grey not blue??
  • From: David Hoerl <email@hidden>
  • Date: Fri, 19 Oct 2007 16:24:21 -0400

[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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Progress bar on front NSPanel is grey not blue??
      • From: Uli Kusterer <email@hidden>
  • Prev by Date: window de/activation notifications (was Re: inappropriate tool palette activation problem)
  • Next by Date: Re: Getting list of classes inside NSBundle
  • Previous by thread: Re: window de/activation notifications (was Re: inappropriate tool palette activation problem)
  • Next by thread: Re: Progress bar on front NSPanel is grey not blue??
  • Index(es):
    • Date
    • Thread