• 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
Re: Hiding tab view items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hiding tab view items


  • Subject: Re: Hiding tab view items
  • From: Kyle Sluder <email@hidden>
  • Date: Wed, 21 Oct 2009 00:23:06 -0700

On Wed, Oct 21, 2009 at 12:02 AM, BareFeet <email@hidden> 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@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Hiding tab view items
      • From: BareFeet <email@hidden>
References: 
 >Hiding tab view items (From: BareFeet <email@hidden>)
 >Re: Hiding tab view items (From: Volker in Lists <email@hidden>)
 >Re: Hiding tab view items (From: BareFeet <email@hidden>)
 >Re: Hiding tab view items (From: BareFeet <email@hidden>)

  • Prev by Date: NSInputStream / Eventqueue / run in Background
  • Next by Date: Re: Hiding tab view items
  • Previous by thread: Re: Hiding tab view items
  • Next by thread: Re: Hiding tab view items
  • Index(es):
    • Date
    • Thread