Re: Drawing many different strings quickly
Re: Drawing many different strings quickly
- Subject: Re: Drawing many different strings quickly
- From: Quincey Morris <email@hidden>
- Date: Mon, 28 Sep 2015 10:48:43 -0700
- Feedback-id: 167118m:167118agrif8a:167118sfU3N2kAaz:SMTPCORP
On Sep 28, 2015, at 01:41 , Ben <email@hidden> wrote:
>
> Unfortunately NSTableView doesn't offer the type of interactions I want. I have filed a radar requesting enhancements.
What about a hybrid approach? Use a NSTableView to draw the strings as a background “layer” of your scroll view, and put a sibling view on top of it that handles your interactions.
This should be pretty easy if the interactions involve only the grid cells, since their geometry is easy to calculate on the fly. If users need to interact with the text itself (e.g. if they can select portions of the strings), it would be harder, but you could try an approach analogous to a field editor: a temporary overlay view on the cell or row that’s being interacted with.
If you must deal with the performance yourself, then you could drop down to CoreText and bypass as much of the machinery as possible. CTLine probably contains everything you need, if you’re not trying to cache anything (except the CTLineRefs themselves, which may be feasible, since you’re using gobs of memory anyway). But remember that CTLine utility functions that do layout will create CTTypesetters, and that’s the expensive part.
Or you can try something clever like “batching” strings as paragraphs in a larger string, cacheing CTTypesetters for the larger strings, and spinning off individual CTLineRefs as needed for drawing.
_______________________________________________
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