Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set max chars for Unicode Edit Text control?



Am 26.07.2004 um 07:23 schrieb Laurence Harris:

How exactly do you want to limit the text?

Just limit it to a maximum of characters. Let's say the text field can hold 5 characters I want it to beep on the sixth and not add it to the text (or beep on paste if I would support paste).

I tried Laurence' suggestion installing an
kEventTextInputUnicodeForKeyEvent handler, but it failed for Japanese.
I have to try your suggestion.

Failed in what way?

From the event handler I check the string length and beep and return noErr when the maximum is reached, so that the key is swallowed.
However when I type Japanese the handler is not called for every character but only after each "bunch" of Japanese. So if text length is let's say 4 which would be enough to hold another character I can type a bunch of Japanese and exceed the limit.


Manfred
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Set max chars for Unicode Edit Text control? (From: Laurence Harris <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.