Re: How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)?
Re: How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)?
- Subject: Re: How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)?
- From: Keith Wilson <email@hidden>
- Date: Tue, 14 Mar 2006 10:23:23 +1100
On 13 Mar 2006, at 22:46, Andrei Tchijov wrote:
Yes. Typically I am getting reference to "particular view" as a
sender parameter to an action. What exactly action will do,
depends on on which "tab" this sender located.
Hi Andrei,
The Tabview identifier can be set in IB as a string but can later be
reassigned to any Object.
Let's assume that each tab contains an NSTableView called pTable1,
pTable2, pTable2 and these have IBOutlets in the controller for your
tabview.
In Interface Builder give each tab in the tabview an Identifier - a
NSString - that is called table1, table2, table3, etc
In awakeFromNib change each tab identifier to be the NSTableView
object table1, table2, table3, etc using
if(tvi identifier] isEqualToString:@"table1"]
[tvi setIdentifier:pTable1];
if(tvi identifier] isEqualToString:@"table2"]
[tvi setIdentifier:pTable2];
etc ....
Now each tab knows the object that it is associated with without
worrying about traversing the view hierarchy and you can do things like
NSTabViewItem *tvi = [pTabView selectedTabViewItem];
if([[tvi identifier] respondsToSelector:@selector(doSomething:)])
[[tvi identifier] doSomething:xxxxt];
Keith from DownUnder
_______________________________________________
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