• 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: Which NSTabViewItem am I in?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which NSTabViewItem am I in?


  • Subject: Re: Which NSTabViewItem am I in?
  • From: Brock Brandenberg <email@hidden>
  • Date: Sun, 04 May 2003 13:24:36 -0500

> If I am an NSView subclass placed in one of several NSTabViewItems, how
> can I programatically determine which NSTabViewItem I am in? I'm
> looking for a way to do this generally, i.e. I'd rather not code it
> with foreknowledge of the view hierarchy.

Walk your way up the view hierarchy to the NSTabView and message it to get
the current item:

NSTabViewItem *theItem = nil;
NSView *result = self;
while( result = [result superview] )
{
if( [result isKindOfClass:[NSTabView class]] )
{
theItem = [(NSTabView *)result selectedTabViewItem];
break;
}
}

Brock Brandenberg

----- industrial design @ www.bergdesign.com ------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Cocoa/Applescript question
  • Next by Date: NSDrawer doesn't scroll out far enough??
  • Previous by thread: Cocoa/Applescript question
  • Next by thread: NSDrawer doesn't scroll out far enough??
  • Index(es):
    • Date
    • Thread