Ok, as simple and silly as that may seem, this is my scenario :
Simple?
Not quite.
I've tried accessing my main window via :
[[NSApplication sharedApplication] mainWindow]
[[NSApplication sharedApplication] windows]
and then sending a makeKeyAndOrderFront:
message but it's simply NOT showing up.
I've even tried showing all windows (yep, it still sees as "windows" one-or-two (hidden) sheets I'm using...), but still nothing.
Could you suggest a way, I could finally show that window, WITHOUT having to set an outlet anywhere?
I don't know; I'm probably too tired to notice, but this thing is almost nerve-wrecking...
You can un-minimize a window like so:
if([aWindow isMiniaturized])
{
[aWindow deminiaturize:self];
}
However, the problem is that the window will lose main status when it is minimized, so you'll need some other way of identifying the window.
Why can't you just use an outlet?
You can make the app un-minimize all of its minimized windows like so:
for(NSWindow* win in [NSApp windows])
{
if([win isMiniaturized])
{
[win deminiaturize:self];
}
}
When the app launches, you could store a reference to the main window and register for the NSWindowDidMiniaturizeNotification
. That will tell you when the main window minimizes, which might also help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With