Opening a panel in my application

Discussion in 'Mac Programming' started by BadWolf13, Mar 20, 2010.

  1. BadWolf13 macrumors 6502

    Joined:
    Dec 17, 2009
    #1
    Second post today, yeah, I'm having a bad day.

    My application is set to open another window from the main window. I have a subclass of NSWindowController and using an instance of that subclass called details. The following line of code opens the window.

    Code:
    	[details showWindow:self];
    
    It opens the window, yet for some reason, the main window remains the "active" window. Now correct me if I'm wrong, but shouldn't a newly opened window automatically become the "active" window?
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Do you have the window outlet connected in IB? If not, connect it.

    On the window's properties, do you have "Visible at Launch" enabled? If yes, uncheck it.
     
  3. BadWolf13 thread starter macrumors 6502

    Joined:
    Dec 17, 2009
    #3
    Perhaps I should have mentioned that the panel is a separate XIB file.

    When I uncheck "Visible at Launch", the panel doesn't show at all when I click the button in the main window.

    Also, I don't have a window outlet, just a subclass of NSWindowController. Could this be a problem?
     
  4. zophtx macrumors member

    Joined:
    Mar 8, 2010
    Location:
    Inside a Cocoa Book
    #4
    this just solved one of my problems thanks :)

    oh ya.. @badwolf read this post and hopefully it solves your problem

    http://forums.macrumors.com/showthread.php?t=213198

    :D
     
  5. BadWolf13 thread starter macrumors 6502

    Joined:
    Dec 17, 2009
    #5
  6. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #6
    NSWindowController provides the window outlet, which will be available when you right-click File Owner.
     
  7. BadWolf13 thread starter macrumors 6502

    Joined:
    Dec 17, 2009

Share This Page