[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getting Events of NSTextField
- Subject: getting Events of NSTextField
- From: Bill Cheeseman cheeseb@xxxxxxxxx
- Date: Thu, 04 Jan 2001 04:54:29 -0500
on 1/3/01 8:46 PM, Tom Woteki at drwo@xxxxxxxxxx wrote:
> NSFormatter implements a method:
>
> public boolean isPartialStringValid(String partialString)
>
> that the text field sends to the formatter at each keystroke. You can
> inspect and react to the partial string (i.e. last keystroke) before it is
> visible to the user.
Actually, I think this is a delegate method, so you have to subclass
NSFormatter (or NSNumberFormatter or NSDateFormatter) and implement this
method yourself. But it's very easy to do. Especially if you subclass one of
the built-in subclasses, so that you only have to implement this one method.
But it still won't catch naked modifier keys, will it?
-
Bill Cheeseman, Quechee, Vermont <mailto:cheeseb@xxxxxxxxx>
The AppleScript Sourcebook
<http://www.AppleScriptSourcebook.com/>
Vermont Recipes-A Cocoa Cookbook
<http://www.stepwise.com/Articles/VermontRecipes/>