Re: Is -rangeOfUserTextChange: supposed to wipe out marked text/diacritical marks?
Re: Is -rangeOfUserTextChange: supposed to wipe out marked text/diacritical marks?
- Subject: Re: Is -rangeOfUserTextChange: supposed to wipe out marked text/diacritical marks?
- From: Keith Blount <email@hidden>
- Date: Thu, 20 Nov 2008 14:11:11 -0800 (PST)
Great, thank you. I've changed the validation code as per your suggestion and everything seems to be working fine now; I had been under the mistaken impression that these methods were always the right ones to call when checking the text that *could* be changed, so I had changed many references to -selectedRange to use these methods - which explains why I only got bug reports about accents in recent versions.
Thanks again and all the best,
Keith
--- On Thu, 11/20/08, Douglas Davidson <email@hidden> wrote:
> From: Douglas Davidson <email@hidden>
> Subject: Re: Is -rangeOfUserTextChange: supposed to wipe out marked text/diacritical marks?
> To: email@hidden
> Cc: email@hidden
> Date: Thursday, November 20, 2008, 9:10 PM
> On Nov 20, 2008, at 12:59 PM, Keith Blount wrote:
>
> > I've had some bug reports from users saying that
> accented characters don't always work correctly in my
> software, but I've never been able to reproduce it -
> until now. It seems that calling NSTextView's
> -rangeOfUserTextChange: and
> -rangeOfUserCharacterAttributeChange: wipes out marked text
> in a text view, and I'm wondering if this sounds like
> intended behaviour before I file a bug report on this...
> >
> > The problem in my case is that I call
> -rangeOfUserTextChange: or
> -rangeOfuserCharacterAttributeChange: from interface
> validation code (-validateUserInterfaceItem:) for certain
> items - for instance, to check to see whether it is
> currently possible to annotate some text (for which there
> must be some text selected that can have its attributes
> changed). If there is a toolbar item that calls on such
> validation code, suddenly accented characters stop working.
>
> Yes, these methods unmark the text. They're generally
> intended to be called when a change is actually going to be
> made. One alternative would be for you to call -isEditable
> and -selectedRange in your validation code instead.
>
> Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden