PDA

View Full Version : Launching a HUD Window




stadidas
Nov 24, 2007, 03:23 PM
I'm sure this is probably very simple, but I've been looking around for a way to load a window from a NIB file and can't find anywhere that tells me what I need.
Basically, I have a HUD window (NSPanel) in my MyDoucment.nib that I want to load when a button is pressed on the main window. I have attached an action to this button, I just need the code that will load a window from the NIB file. I know how to do it as a sheet, I just can't seem to figure out to launch a separate window.

Thanks for any help!



Darkroom
Nov 24, 2007, 04:12 PM
I'm sure this is probably very simple, but I've been looking around for a way to load a window from a NIB file and can't find anywhere that tells me what I need.
Basically, I have a HUD window (NSPanel) in my MyDoucment.nib that I want to load when a button is pressed on the main window. I have attached an action to this button, I just need the code that will load a window from the NIB file. I know how to do it as a sheet, I just can't seem to figure out to launch a separate window.

Thanks for any help!

you're button action should be like this:


-(IBAction)actionName:(id)sender {
NSPanel* panelName;
[panelName makeKeyAndOrderFront:nil];
}


... i think... i'm fairly new too but that's how i'd write it...

stadidas
Nov 24, 2007, 04:17 PM
Excellent, the makeKeyAndOrderFront: method worked a treat, cheers.