Mailing Lists: Apple Mailing Lists

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

Monitoring NSTextView Attributes



We have code that likes to monitor the current selection in an NSTextView and update the attributes of a panel (text color, background color, font size, things like that) as the user enters text.

Our code is currently observing NSTextStorageDidProcessEditingNotification and NSTextViewDidChangeSelectionNotification. In response to those we use calls like rangeForUserCharacterAttributeChange and attributesAtIndex:effectiveRange: to figure out what attributes the inspector should display.

The difficulty with this approach is that it seems to trip up Japanese text entry. The glyphs that the user types go in, but at the point where the user is supposed to be able to combine glyphs, choose alternate forms, and things like that, we don't give them that opportunity.

I guess one of the routines we use to discover the current attributes is "ending" the inline editing session.

Can anyone point me to documentation on the right way to monitor the character attributes of the selection in an NSTextView?

Scott

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

This email sent to 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.