Re: Automatic key view handling
Re: Automatic key view handling
- Subject: Re: Automatic key view handling
- From: Ricky Sharp <email@hidden>
- Date: Mon, 21 Feb 2005 08:58:17 -0600
On Monday, February 21, 2005, at 08:09AM, Ricky Sharp <email@hidden> wrote:
>What I could do is that whenever my tab view changes, I can somehow sense that no view currently has first responder status (my guess is that firstResponder will return nil. I can then call [myTablessTabView nextValidKeyView] to find the view (if any) that should now have first responder status.
A solution (workaround) in case anyone needs it.
For example, a radio button set wired to control which tab of a tabless tab view is displayed:
- (IBAction)setFirstTab:(id)sender
{
[tabView selectTabViewItemAtIndex:0];
NSWindow* theWindow = [tabView window];
if ([theWindow firstResponder] == theWindow)
{
NSResponder* theNewResponder = [tabView previousValidKeyView]; // [ 1 ]
if (theNewResponder != nil)
{
[theWindow makeFirstResponder:theNewResponder];
}
}
}
[ 1 ] The new responder can also be the result of nextValidKeyView; all depends on what you need.
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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