NSPanel Creation

Discussion in 'Mac Programming' started by alexcurtis, Jun 11, 2010.

  1. alexcurtis macrumors newbie

    Joined:
    Jun 11, 2010
    #1
    Hi,

    I have a problem creating and launching a NSPanel from a NSWindowController.

    In The NSWindowController (EditCountdownController: init)
    Code:
    self = [super initWithWindowNibName:@"EditCountdown"];
    return self;
    

    In The Main Window Controller (This Creates The Window Controller Object etc)
    Code:
     if(!m_edit_controller)
      {
        m_edit_controller = [[EditCountdownController alloc] init];
      }
     
      [m_edit_controller showWindow:self];
    
    Now if i turn off "Visible at launch" in interface builder, the panel doesnt show up at all. If its switched on it turns up on the correct event, but if i close the panel (using x at top) and try and reopen it doesnt show.

    Many Thanks,
    -Alex
     
  2. Sydde macrumors 68020

    Sydde

    Joined:
    Aug 17, 2009
    #2
    I have never worked with window controllers before, is there a particular need or advantage for doing this vs. just communicating directly with the panel?
     
  3. alexcurtis thread starter macrumors newbie

    Joined:
    Jun 11, 2010
    #3
    Ideally I would like to use a controller because of its reuse properties and this application is going to grow to a substantial size.

    Many Thanks,
    -Alex
     
  4. alexcurtis thread starter macrumors newbie

    Joined:
    Jun 11, 2010
    #4
    Ok. I worked it out.

    I forgot to link the window referencing outlet (in the NSPanel) to the Fileowner (The Controller)

    Cheers,
    -Alex
     

Share This Page