Re: Which NSTabViewItem am I in?
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.