Moving An NSTableView From One View To Another

  • Hello all,

    I am trying to move an NSTableView from a custom view into a window.
    In IB, I dragged a CustomView into my nib file and added a bunch of
    subviews to it. Then I used this code to add one of the subviews to
    my window:

    - (IBAction)addView:(id)sender
    {
    [[window contentView] addSubview:[myView viewWithTag:1]];
    [[window contentView] display];
    }

    This works fine for text fields and buttons, but when it comes to a
    tableview, it won't show it.
    Does anyone know why this won't work? Thanks in advance.

    - Luke
  • > I am trying to move an NSTableView from a custom view into a window.
    > In IB, I dragged a CustomView into my nib file and added a bunch of
    > subviews to it. Then I used this code to add one of the subviews to
    > my window:

      <snip>

    > This works fine for text fields and buttons, but when it comes to a
    > tableview, it won't show it.
    > Does anyone know why this won't work? Thanks in advance.

      Are you keeping in mind that the NSTableView is enclosed in a scroll
    view, etc.?

    --
    I.S.
  • On Oct 15, 2007, at 11:46 AM, I. Savant wrote:

    >> I am trying to move an NSTableView from a custom view into a window.
    >> In IB, I dragged a CustomView into my nib file and added a bunch of
    >> subviews to it. Then I used this code to add one of the subviews to
    >> my window:
    >
    > <snip>
    >
    >> This works fine for text fields and buttons, but when it comes to a
    >> tableview, it won't show it.
    >> Does anyone know why this won't work? Thanks in advance.
    >
    > Are you keeping in mind that the NSTableView is enclosed in a scroll
    > view, etc.?
    >
    > --
    > I.S.

    Oops, I forgot about that. I reworked the code to get the scroll view
    and now it works. Thanks!

    - Luke
previous month october 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