moving an NSTabViewItem
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