• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
moving an NSTabViewItem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

moving an NSTabViewItem


  • Subject: moving an NSTabViewItem
  • From: Ken Victor <email@hidden>
  • Date: Wed, 29 Mar 2006 16:49:22 -0800

i've got a window with an NSTabView with 3 tabs/NSTabViewItems created in IB. this window displays fine.

now i'd like to be able to programmatically add additional tabs. i've created another nib file containing a custom view that contains an NSTabView with 2 tabs. the first tab is the one i want to move to my original window.

i'm (unsuccessfully) using the following code:

NSTabView* nibTabView = ... // successfully find the NSTabView from 2nd nib file
NSTabViewItem* tvi = [[nibTabView tabViewItemAtIndex: 0] retain];
[nibTabView removeTabViewItem: tvi];


NSTabView* windowTabView = ... // tab view in window that i wish to add to
[windowTabView addTabViewItem: tvi];

[tvi release];

this code successfully shows the new tab (with the appropriate label), but doesn't display any of the objects from the NSTabViewItem from the second nib file.

if i insert the line of code as follows:

NSTabView* windowTabView = ...
[windowTabView addSubview: [tvi view]];   // new line of code
[windowTabView addTabViewItem: tvi];

then the subviews from the second nib file show up on the original first 3 tabs until i click on the newly added tab. the subviews still don't show up in the newly added tab, but when i then click back to one of the original 3 tabs, the new subviews no longer show.

can anyone shed some light on what's wrong with the above? or more to the point, how to programmatically add an IB created NSTabViewItem from one nib file to a different NSTabView?

thanx,
ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: moving an NSTabViewItem
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Re: how to select a nstabviewitem index
  • Next by Date: distribution app (was: disk image making)
  • Previous by thread: Re: Cocoa Newbies: Is this the best list?
  • Next by thread: Re: moving an NSTabViewItem
  • Index(es):
    • Date
    • Thread