FROM : Matt Neuburg
DATE : Tue Aug 01 17:14:37 2006
On Mon, 31 Jul 2006 13:54:48 -0700, John Stiles <<email_removed>> 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_removed>, <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>
DATE : Tue Aug 01 17:14:37 2006
On Mon, 31 Jul 2006 13:54:48 -0700, John Stiles <<email_removed>> 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_removed>, <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>
| Related mails | Author | Date |
|---|---|---|
| John Stiles | Jul 28, 04:15 | |
| John Stiles | Jul 31, 22:54 | |
| Wagner Truppel | Jul 31, 23:45 | |
| John Stiles | Aug 1, 00:03 | |
| Ricky Sharp | Aug 1, 02:24 | |
| John Stiles | Aug 1, 02:53 | |
| Matt Neuburg | Aug 1, 17:14 | |
| John Stiles | Aug 1, 17:30 | |
| Ricky Sharp | Aug 1, 18:22 | |
| Ricky Sharp | Aug 1, 18:25 | |
| Matt Neuburg | Aug 1, 18:38 | |
| John Stiles | Aug 1, 19:09 | |
| Matt Neuburg | Aug 1, 19:35 |






Cocoa mail archive

