Launching a HUD Window

Discussion in 'Mac Programming' started by stadidas, Nov 24, 2007.

  1. macrumors regular

    Joined:
    Feb 27, 2006
    Location:
    Kent, United Kingdom
    #1
    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!
     
  2. Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #2
    you're button action should be like this:

    Code:
    -(IBAction)actionName:(id)sender {
     NSPanel* panelName;
     [panelName makeKeyAndOrderFront:nil];
    }
    
    ... i think... i'm fairly new too but that's how i'd write it...
     
  3. thread starter macrumors regular

    Joined:
    Feb 27, 2006
    Location:
    Kent, United Kingdom
    #3
    Excellent, the makeKeyAndOrderFront: method worked a treat, cheers.
     

Share This Page