On Wed, Oct 21, 2009 at 12:02 AM, BareFeet <[email protected]> wrote:
> This seems like a common requirement, so I keep thinking I must be missing
> something simple.
Nope. You're going to need to write code. The "hardest" part is
replacing the tab view items; this really isn't that difficult:
// Typed in Mail
- (void)updateTabView:(NSTabView *)tabView withItems:(NSArray *)newItems;
{
NSArray *oldItems = [tabView tabViewItems];
NSInteger newLocation = 0;
for (NSTabViewItem *newItem in newItems) {
NSInteger existingLocation = [tabView indexOfTabViewItem:newItem];
if (existingLocation != NSNotFound)
[tabView removeTabItem:newItem];
[tabView insertTabViewItem:newItem atIndex:newLocation++];
}
for (NSTabViewItem *oldItem in oldItems)
if (![newItems containsObject:oldItem])
[tabView removeTabViewItem:oldItem]
}
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]