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 25.07.2004 um 23:39 schrieb Laurence Harris:
On 7/25/04 4:53 PM, Manfred Schubert didst favor us with:

How can I set the maximum characters for a Unicode edit text control? I
can't find it.

That's because you can't. Unfortunately this is not a simple task if you
want to cover all the possibilities. You can install a
kEventTextInputUnicodeForKeyEvent handler to see text being entered into the
control and return noErr if you don't want to accept the text, but that
won't help with pasting. For that I think you'll need to install a
kEventCommandUpdateStatus handler to disable those commands when you don't
want to allow the current text to be pasted. There may be some other issues
I'm not thinking of as well.

Oh, that's unfortunate. I thought there must have been an easy way for the common task.

Isn't there any event that is send every time the text changes? I could then simply shorten it to the max length and it would cover all cases. I'm not getting kEventControlValueFieldChanged and kEventControlTitleChanged.


Thanks,

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.