• 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: Stop edit session with a NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stop edit session with a NSTextField


  • Subject: Re: Stop edit session with a NSTextField
  • From: Andy Lee <email@hidden>
  • Date: Wed, 25 Feb 2009 11:14:44 -0500

On Feb 24, 2009, at 6:08 PM, Eric Gorr wrote:
*** [[[self view] window] makeFirstResponder:[self view]];

Pressing return will allow the editing session to end, but pressing the tab key will not

Looks like controlTextDidEndEditing: is too deep within the text field's event handling to muck with the first responder. Delaying the call to makeFirstResponder: seems to work:


[[[self view] window] performSelector:@selector(makeFirstResponder:) withObject:nil afterDelay:0.0];

(Note this passes nil to makeFirstResponder: rather than the view.) I don't know if this is foolproof -- for example, I haven't tried it with different accessibility settings. And note that if you normally have a tab loop this will defeat the tab loop.

--Andy


aglee

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Stop edit session with a NSTextField
      • From: Eric Gorr <email@hidden>
References: 
 >Stop edit session with a NSTextField (From: Eric Gorr <email@hidden>)
 >Re: Stop edit session with a NSTextField (From: Patrick Mau <email@hidden>)
 >Re: Stop edit session with a NSTextField (From: Eric Gorr <email@hidden>)
 >Re: Stop edit session with a NSTextField (From: Patrick Mau <email@hidden>)
 >Re: Stop edit session with a NSTextField (From: Eric Gorr <email@hidden>)
 >Re: Stop edit session with a NSTextField (From: Eric Gorr <email@hidden>)
 >Re: Stop edit session with a NSTextField (From: Eric Gorr <email@hidden>)

  • Prev by Date: RE: [Q] What causes an NSArrayController to know that an entity was inserted via a different window?
  • Next by Date: willAnimateFirstHalfOfRotationToInterfaceOrientation not called...
  • Previous by thread: Re: Stop edit session with a NSTextField
  • Next by thread: Re: Stop edit session with a NSTextField
  • Index(es):
    • Date
    • Thread