• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Prevent space characters in a NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Prevent space characters in a NSTextField


  • Subject: Prevent space characters in a NSTextField
  • From: Lorenzo <email@hidden>
  • Date: Mon, 22 Nov 2004 18:08:57 +0100

Hi,
even if I attach an "integer formatter" into my NSTextField, whenever the
user hits the space key I see the space written within the field and, in
some cases, replacing the old value.
Of course at the end of the editing the formatter doesn't accept the string,
but I would like to totally ignore all the characters different than numbers
and "." and ",". This way, if the user hit a space or a "x", the field
doesn't get modified at all.

How can I do?


Just to say, I assigned an action to the space key, so if a field is on
editing and the user hits the space key, he deletes accidentally the content
of the field... boring! Instead I would like to launch the action.


Best Regards
--
Lorenzo
email: email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Prevent space characters in a NSTextField
      • From: "Sean McBride" <email@hidden>
    • Re: Prevent space characters in a NSTextField
      • From: Yann Bizeul <email@hidden>
  • Prev by Date: Re: Crash on [event locationInWindow]
  • Next by Date: Re: How to disable/gray an NSTextfield (used as static text)
  • Previous by thread: Re: Again: Using mouseEntered and mouseExited
  • Next by thread: Re: Prevent space characters in a NSTextField
  • Index(es):
    • Date
    • Thread