Re: number formatters and bindings
Re: number formatters and bindings
- Subject: Re: number formatters and bindings
- From: Matt Neuburg <email@hidden>
- Date: Thu, 04 Jan 2007 08:43:38 -0800
- Thread-topic: number formatters and bindings
On or about 1/1/07 12:15 AM, thus spake "email@hidden"
<email@hidden>:
> Date: Sat, 30 Dec 2006 12:47:00 -0500
> From: Mitchell Livingston <email@hidden>
> Subject: number formatters and bindings
> To: email@hidden
>
> I want to have a text field where a user can only enter in numbers
> within a certain range (usually 0 and up) but it also needs to use
> bindings. When I use bindings and number formatters and enter an
> invalid value I get a error dialog with "Invalid number" or "Fell
> short of minimum" and the options "OK" and "Discard Changes". Is
> there a way to make the field simply beep and revert to the previous
> values (or something similar)?
<http://www.cocoabuilder.com/archive/message/cocoa/2006/11/28/175157>
In other words, in your case, don't attach the formatter to the text field;
implement validateValue:forKeyPath:error: in the NSController and do
whatever you want. m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide - Second Edition!
http://www.amazon.com/gp/product/0596102119
Take Control of Word 2004, Tiger, and more -
http://www.takecontrolbooks.com/tiger-customizing.html
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden