On Sep 28, 2015, at 01:41 , Ben <ben_cocoa_dev_l...@yahoo.co.uk> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to