Hide and Show HUD Window - Cocoa?

lab12 picture lab12 · Sep 6, 2009 · Viewed 7.8k times · Source

I have a HUD window that has some labels on it, and I want this to show when the user presses a button. I know this is simple, but I can't get it to show again unless I restart my program.

Sincerely,

Kevin

Answer

Scott Greenlay picture Scott Greenlay · Sep 6, 2009

To hide hudWindow:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    [hudWindow orderOut:nil]; // to hide it
}

Then on button press:

- (IBAction)showWindow:(id)sender {
    [hudWindow makeKeyAndOrderFront:nil]; // to show it
}