View Full Version : How to identify app is currently show or hide?

Jun 6, 2011, 11:25 PM
Hi all

i using this to sho and hide my app

[mainwindow orderOut:nil]; // to hide it

[mainwindow makeKeyAndOrderFront:nil]; // to show it

now please tell at running time how can identify the app is show or hide?

please help me for this.

thanks in advance.

Jun 6, 2011, 11:42 PM
[mainWindow isVisible] && ![mainWindow isMiniaturized]

Jun 7, 2011, 12:03 AM
[mainWindow isVisible] && ![mainWindow isMiniaturized]

how can i use isVisible from any other class or window?

Jun 7, 2011, 12:21 AM
i m using [controlPanel orderOut:nil]; in awakeFromNib but still the window is show.

Jun 7, 2011, 12:42 AM
Is your goal just to not have the window shown when the nib loaded?

Jun 7, 2011, 01:07 AM
Is your goal just to not have the window shown when the nib loaded?

not alwaz but in certain condition.

Jun 7, 2011, 03:10 AM
Try unticking visible at launch in the window property inspector in interface builder. This will stop the window from appearing automatically. Then order the window on screen when you want it to be shown.

Jun 7, 2011, 04:32 AM
thanks its done from awakeFromNib .
i am automatically start my application using LoginWindow whenever Mac machine is on or whenever any user logged in.

at this time if i place some alert message in awakeFromNib than app is display otherwise its run in hidden mode,i want to detect the automatically start position to avoid this alert message.

[[NSAlert alertWithMessageText:@"Alert Message"
defaultButton:@"OK" alternateButton:nil otherButton:nil
informativeTextWithFormat:@"Alert Message"] runModal];

and please also tell me how can i identify the app is show or hide from other class that is derived from NSObject.