Re: NSTextField filters
Re: NSTextField filters
- Subject: Re: NSTextField filters
- From: Shawn Erickson <email@hidden>
- Date: Tue, 13 Jul 2004 14:08:30 -0700
On Jul 13, 2004, at 11:39 AM, Bret Kurth wrote:
How can I install a key filter on an NSTextField? I have fought with
using an NSFormatter object for several days now. It hasn't helped me
and it brings along a lot of undesirable behavior.
I merely wish to test if the key pressed is within a set of my
choosing and allow or disallow the key based on the result.
Have you reviewed the following?
<
http://developer.apple.com/documentation/Cocoa/Conceptual/
DataFormatting/Tasks/CreatingACustomFormatter.html>
What issues are you having with NSFormatter?
Anyway I believe overriding
isPartialStringValid:newEditingString:errorDescription gets you want
you want. Additionally have getObjectValue:forString:errorDescription:
pass out the string passed in (assuming you are just dealing with
strings) and stringForObjectValue: just take the object in and return
it as the string (assuming again you are just working with strings).
I wonder if anyone has a simple regexp based formatter available?
-Shawn
_______________________________________________
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.