1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

How to identify app is currently show or hide?

Discussion in 'Mac Programming' started by newformac, Jun 6, 2011.

  1. macrumors regular

    #1
    Hi all

    i using this to sho and hide my app

    Code:
    [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.
     
  2. macrumors 65816

    jiminaus

    #2
    [mainWindow isVisible] && ![mainWindow isMiniaturized]
     
  3. macrumors regular

    #3
    how can i use isVisible from any other class or window?
     
  4. macrumors regular

    #4
    i m using [controlPanel orderOut:nil]; in awakeFromNib but still the window is show.
     
  5. macrumors 65816

    jiminaus

    #5
    Is your goal just to not have the window shown when the nib loaded?
     
  6. macrumors regular

    #6
    not alwaz but in certain condition.
     
  7. macrumors 65816

    jiminaus

    #7
    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.
     
  8. newformac, Jun 7, 2011
    Last edited by a moderator: Jun 7, 2011

    macrumors regular

    #8
    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.

    Code:
    [[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.
     

Share This Page