Noone has an idea?
To elaborate, when not using bindings, the default behavior of text fields with a number formatter is that when a user tries to enter "abc" in it, the text field refuses to lose focus and makes a beeping sounds. However, when the text field's value binding has been set, a sheet is shown, which I think is a bad user experience. In fact it would be even better to just disallow entering of invalid characters in the first place. But such a method would have to work even if the text field's value binding is set. Thank you, U ---------------------------------------- > From: ulaibee...@hotmail.com > To: cocoa-dev@lists.apple.com > Date: Wed, 22 Apr 2009 15:26:51 +0000 > Subject: Bindings making NSNumberFormatter strange > > > Hi, > > I have an (editable) NSTextField with an NSNumberFormatter attached to it. > The text field is bound to some other numerical property (if you want to test > this, you can just make a simple AppController and put the > "@property(readwrite) int foo;" inside it, and bind the text field to > AppController's foo). > > My problem is that when I type some invalid stuff in the text field, such as > some letters "abc", I don't get a beep (which is the normal behaviour and the > one I want), but I get some sheet popping up saying "Formatting Error". I > don't want this sheet. I want the beep like usual. How can I get rid of this > sheet behaviour that the bindings is causing? And why is it even causing it? > > Second question: How can I make my text field just disallow entering of > invalid characters in the first place (and producing beep when it is tried)? > I want, as you probably guessed, a method that is compatible with bindings. > > Thanks very much, > U . _________________________________________________________________ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com