Visible At Launch for Panels

  • In response to the user selecting a particular item, I create a panel
    from a nib.  If the "Visible At Launch" check box in the inspector of
    the nib containing the panel is checked, the panel is displayed, just
    as I would expect. However, if the check box is not checked, the panel
    is not displayed, again as I would expect.  However, it seems like I
    should programatically be able to make the panel visible by using
    windowDidLoad:  or awakeFromNib:  (or ... ?) with

    [[self window] makeKeyAndOrderFront:[self window]];
    [self showWindow:self];

    in the body of one or another of these methods. But I've not succeeded
    in coming up with the appropriate combination of steps for doing
    this.  Seems like it should be very easy, but I'm obviously deficient
    in understanding something, so any help would be appreciated.

    Boyd
  • On Dec 21, 2007 2:51 PM, Boyd Collier <bcollier...> wrote:

    > In response to the user selecting a particular item, I create a panel
    > from a nib.  If the "Visible At Launch" check box in the inspector of
    > the nib containing the panel is checked, the panel is displayed, just
    > as I would expect. However, if the check box is not checked, the panel
    > is not displayed, again as I would expect.  However, it seems like I
    > should programatically be able to make the panel visible by using
    > windowDidLoad:  or awakeFromNib:  (or ... ?) with
    >
    > [[self window] makeKeyAndOrderFront:[self window]];
    > [self showWindow:self];

    > From the methods you're calling here, I assume that "self" in the above is
    an NSWindowController subclass, and is the loaded NIB's owner. That said,
    have you told IB the class of the NIB's owner, and connected the owner's
    "window" outlet?

    sherm--
  • Sherm,

    Thanks very much for answering my question.  Your assumptions were
    correct, and I had indeed botched up connecting the outlet in the
    NIB's owner to my panel.  That's what I get for trying to use the new
    Interface Builder without taking time to understand its new interface.

    Boyd

    On Dec 21, 2007, at 2:53 PM, Sherm Pendley wrote:

    > On Dec 21, 2007 2:51 PM, Boyd Collier <bcollier...>
    > wrote:
    > In response to the user selecting a particular item, I create a panel
    > from a nib.  If the "Visible At Launch" check box in the inspector of
    > the nib containing the panel is checked, the panel is displayed, just
    > as I would expect. However, if the check box is not checked, the panel
    > is not displayed, again as I would expect.  However, it seems like I
    > should programatically be able to make the panel visible by using
    > windowDidLoad:  or awakeFromNib:  (or ... ?) with
    >
    > [[self window] makeKeyAndOrderFront:[self window]];
    > [self showWindow:self];
    >
    > From the methods you're calling here, I assume that "self" in the
    > above is an NSWindowController subclass, and is the loaded NIB's
    > owner. That said, have you told IB the class of the NIB's owner, and
    > connected the owner's "window" outlet?
    >
    > sherm--
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today