Re: NSLayoutManager question
Re: NSLayoutManager question
- Subject: Re: NSLayoutManager question
- From: Paul Bayley <email@hidden>
- Date: Wed, 20 Feb 2002 16:56:28 -0800
At 1:22 PM -0800 2/20/02, Douglas Davidson wrote:
>
On Wednesday, February 20, 2002, at 12:24 PM, Paul Bayley wrote:
>
>
>Nobody on this list has tried this.
>
>
Or if they have, they haven't informed you of it.
>
>
>I'm not clear what the selection process is then. I know NSTextView knows where the mouseDown occurs, but I thought it passed that information to NSLayoutManager so it could make the selection. For example if one document spans two views (like page 1+2) how would NSTextView know what to select? I thought that each view would report each end of the selection to NSLayoutManager which would perform the selection (not only visually but also creating a text range).
>
>
Certain things are shared between multiple text views attached to a given layout manager. Among them is the selectedRange. The text view that receives the mouseDown: handles the resulting modal loop, and determines the selection, based on information gathered from the shared layout manager as I described. All that must be done here is to set the selectedRange as desired; the text machinery will take care of displaying it.
>
>
Douglas Davidson
I don't suppose there is any documentation which explains this process in more detail.
I'm guessing I have to override mouseDown/Dragged/Up/Moved in NSTextView to bypass methods like:
* selectionRangeForProposedRange:granularity: (I wish to avoid the default behavior, but I can't just override this because it'll be called when I don't want it to)
* dragSelectionWithEvent:offset:slideBack: (maybe instead of bypassing this I can call it directly? Is this for generic drags or text drags?)
Something I don't quite understand is if I'm selecting a large document and change the selectedRange by one glyph, will the entire selection have to be updated? To avoid this should I call setSelectedRange:affinity:stillSelecting: instead of setSelectedRange:?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.