• 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
Making Esc abort text editing in a NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Making Esc abort text editing in a NSTextField


  • Subject: Making Esc abort text editing in a NSTextField
  • From: Pierre-Olivier Latour <email@hidden>
  • Date: Thu, 29 Aug 2002 16:56:45 +0200

Hi,

I've got a problem that's driving me nuts:
I'm temporary creating a NSTextField in a view so that the user can change
the value of some text in a drawing. When he's done, he presses return or
click elsewhere, the textfield is destroyed, and the new value replaces the
old one in the drawing.

I'd like to call "[... abortEditing]" when the user presses the Esc key.
Because right now, whatever you do, you cannot quit the textfield without
confirming the value that's inside it. Very annoying.


Is there any way to do this without intercepting events at the window level?

I tried to subclass NSTextfield, watching for keyDown event, insert
characters or whatever without success :-/

_____________________________________________________________

Pierre-Olivier Latour email@hidden
Lausanne, Switzerland http://www.pol-online.net
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Making Esc abort text editing in a NSTextField
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Scroll detection in NSTableView
  • Next by Date: Re: Authenticator class?
  • Previous by thread: Re: altivec matrix functions
  • Next by thread: Re: Making Esc abort text editing in a NSTextField
  • Index(es):
    • Date
    • Thread