Re: NSTextField, NSTextFieldCell, NSTextView... this is a mess, I need help
Re: NSTextField, NSTextFieldCell, NSTextView... this is a mess, I need help
- Subject: Re: NSTextField, NSTextFieldCell, NSTextView... this is a mess, I need help
- From: Sailor Quasar <email@hidden>
- Date: Thu, 10 Jul 2003 22:05:58 -0400
On Thursday, July 10, 2003, at 05:22 PM, Alastair J.Houghton wrote:
The process of intercepting keystrokes that go to a single text field
without subclassing the application or window is proving far more
complex than it ought.
Just out of curiosity, why are you trying to intercept keystrokes? I
only ask because on Windows this is often the way people go about
limiting the types of data that can be entered into edit controls (and
often they miss the fact that they have to deal with cut, copy, paste
etcetera when they do this ;->). If you are trying to do that, then I
think you should be looking at the NSFormatter class instead.
I need to intercept two keystrokes (option-up and option-down), as well
as the sending of the field's action, to implement a history for a
command input area. I've successfully implemented it using a subclass
of NSWindow and of NSTextField, but I'm very unhappy with the violation
of enscapulation principles that comes with that. I'd much rather have
just the field responding to the keys, but the text input architecture
means I either have to trap sendEvent in the field's window (not its
delegate, the window itself!) or replace the field's field editor
(again, not the delegate). I've had zero success with the latter, due
mostly to poor documention on what's really going on inside those
things. NSFormatter is a good idea, but unfortunately is never asked
about keystrokes involving the arrow keys so can not handle what I
need. (I've run tests to verify this).
-- Sailor Quasar, guardian of Leraz's memory
"A face of stone may hide a soul with the deepest Love of all"
Email: email@hidden
_______________________________________________
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.