Re: NSTextView's MarkedText
Re: NSTextView's MarkedText
- Subject: Re: NSTextView's MarkedText
- From: Ken Thomases <email@hidden>
- Date: Mon, 22 Jul 2013 19:30:40 -0500
On Jul 22, 2013, at 7:22 PM, Gordon Apple wrote:
> Thanks for the direct reply. The summaries are few and far between,
> possibly a result of the dev-site outage.
>
> My speculation had to do with the highlighting I am trying to do. I
> currently support setting the background color of selected text. However, I
> would like to have the equivalent of a highlight pen, where the user selects
> a highlight color and then drags across the text. I cache the current
> selection highlight color, then change the selection highlight to the chosen
> color. The intent (not completely implemented yet) is, on mouseUp, to then
> set the background color, deselect the text, and restore normal
> highlighting. I have created an augmented iBeam cursor (including a color
> patch), but have had difficulty getting the text cursor to switch from the
> iBeam to mine.
>
> I was thinking that, if markedText worked the way I was speculating, maybe
> it would be a way to do the pen highlighting, and also allow all markings to
> be easily cleared for the entire text view, if desired. Thus, my other
> questions.
I don't think you should attempt to use marked text for this purpose.
Your code would not normally control which text is marked. This is normally controlled by Cocoa and/or the input method. The text view implements the methods of the NSTextInputClient protocol and through those methods, the framework tells it which text should be marked and when the marking should be cleared.
Regards,
Ken
_______________________________________________
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