On Jun 16, 2008, at 7:16 PM, John Stiles wrote:

I've got some code which subclasses NSTextView in order to provide a custom field editor for NSTextFields. It doesn't do anything too extraordinary, just allows for filtering out some characters, watching for certain events (like deleting characters or changing the selection), etc. It all works
quite well.
Now, it looks like I need to do the same thing with an NSSecureTextField.
Now, digging around, it looks like its field editor is an
NSSecureTextView--which isn't documented or in the headers, AFAICS. Since
it's undocumented, I don't think there is a way I can subclass it.

So is it just not possible to customize the field editor for a secure text
field? :|


Well, you could write your own header for the class and then subclass it, but then you'll have to work whatever magic is necessary to get NSSecureTextField to actually use it, since - windowWillReturnFieldEditor:toObject: isn't called for special text fields. That includes NSTokenField, which also uses its own special & private field editor.

Ultimately, though, this is really hackey and probably shouldn't be done. You can, however, do what you're trying to do with an NSFormatter subclass instead.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [EMAIL PROTECTED]

Reply via email to