Making Esc abort text editing in a NSTextField
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.