Re: Shared NSTextView

2008-08-19 Thread Douglas Davidson
On Aug 18, 2008, at 9:46 PM, Oleg Krupnov wrote: I could go the simple and dull way and create a separate instance of NSTextView for each box, but I am afraid this could be a waste of resources, because layout manager is costy. Also, most of time I only need to display text in boxes, not to edi

Re: Shared NSTextView

2008-08-19 Thread Шкраблюк Павел
Hello, Oleg. > I am developing a custom view, sort of a simple graphic editor, where > the user can draw graphic boxes of different size. Each box should > display its own attributed string bounded by its own size, and when > the user double-clicks any box, he becomes able to edit the box's text >

Re: Shared NSTextView

2008-08-18 Thread Graham Cox
On 19 Aug 2008, at 3:23 pm, chaitanya pandit wrote: But as in your case you will have to use a separate set of above classes for each textView, that means you cannot share the layout manager as it belongs to a single textStorage. Not strictly true, because while the LM is associated with

Re: Shared NSTextView

2008-08-18 Thread chaitanya pandit
You can share an instance of NSTextStorage and NSLayoutManager with multiple NstextContainer+NSTextViews only if you are displaying same text in all those textViews. But as in your case you will have to use a separate set of above classes for each textView, that means you cannot share the la

Re: Shared NSTextView

2008-08-18 Thread Graham Cox
did if you want (or use the framework ;-). I don't use the field editor as it happens, but instead re-use a shared NSTextView on the fly to edit a text object. I do share the NSLayoutManager. The NSLayoutManager is internal so it's just returned as a shared object from a class meth

Shared NSTextView

2008-08-18 Thread Oleg Krupnov
I am developing a custom view, sort of a simple graphic editor, where the user can draw graphic boxes of different size. Each box should display its own attributed string bounded by its own size, and when the user double-clicks any box, he becomes able to edit the box's text in-place. I have read