• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTabView and edit fields
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSTabView and edit fields
      • From: Ricky Sharp <email@hidden>
    • Re: NSTabView and edit fields
      • From: John Stiles <email@hidden>
  • Prev by Date: Re: Checkbox in NSOutlineView. Must move mouse > 3 pixels to toggle
  • Next by Date: Re: problem with use of timeout property of Finder in applescript
  • Previous by thread: Re: Custom Bundle types
  • Next by thread: Re: NSTabView and edit fields
  • Index(es):
    • Date
    • Thread