Re: NSTabView and edit fields
Re: NSTabView and edit fields
- Subject: Re: NSTabView and edit fields
- From: Matt Neuburg <email@hidden>
- Date: Tue, 01 Aug 2006 08:14:37 -0700
- Thread-topic: NSTabView and edit fields
On Mon, 31 Jul 2006 13:54:48 -0700, John Stiles <email@hidden> said:
>I'd really appreciate it if someone would download my demo and see if
>they notice anything obviously wrong with it. The code is dead simple:
>
>- (IBAction)goToFirstTab:(id)sender
>{
> [myTabView selectTabViewItemAtIndex:0];
>}
>
>- (IBAction)goToSecondTab:(id)sender
>{
> [myTextField setStringValue:@""];
> [myWindow makeFirstResponder:myWindow];
> [myTabView selectTabViewItemAtIndex:1];
>}
(1) myWindow outlet was not hooked up, so second line was pointless.
(2) the problem you're describing (the field has apparent focus but typing
does nothing) is easily solved by using delayed performance:
- (void) doIt: (id) dummy {
[myTabView selectTabViewItemAtIndex:1];
}
- (IBAction)goToSecondTab:(id)sender {
[myTextField setStringValue:@""];
[self performSelector:@selector(doIt:) withObject:nil afterDelay:0.1];
}
(3) The real bug here is, it seems to me, that the text field is not
focussed at startup, since it is the only focusable thing in the window. The
behavior otherwise (after the fix above) is right - the text field has focus
when you return to the first tab view, because something must. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
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