Re: Issue of NSStatusBar
Re: Issue of NSStatusBar
- Subject: Re: Issue of NSStatusBar
- From: Ken Thomases <email@hidden>
- Date: Wed, 27 Feb 2013 02:04:46 -0600
On Feb 27, 2013, at 12:59 AM, anni saini wrote:
> I got the solution, just need to check for NSStatusBarWindow className as follows:
> if([awindow isVisible] && ![aWindow aboutWin] && ![aWindow loginWindow] && ![[aWindow className] isEqual:@"NSStatusBarWindow"])
You're relying on Apple-private implementation details that are subject to change at any time. In fact, you can't be sure that all status items use windows of that class even now. That is, it doesn't necessarily require a "change" for this to be wrong; it may be wrong right now and just hasn't happened to show up in your testing.
Furthermore, you have no reason to assume that status bars are the only "secret" windows used by Cocoa. The whole notion of closing windows which you didn't create is irresponsible and inviting trouble. You shouldn't be doing it.
If you (for reasons which escape me) feel the need to close all of your windows, then you have to track all of your windows and close only those. You can either track them by adding and removing them from a list or giving them some unique property so that you can distinguish them.
Regards,
Ken
_______________________________________________
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