Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-26 Thread Jonathan Dann
On 25 Sep 2010, at 01:23, Douglas Davidson wrote: > > On Sep 23, 2010, at 7:54 AM, Jonathan Dann wrote: > >> In our app, Kaleidoscope, I have 2 text views side-by-side. In one >> configuration the layout of the text in each text view is dependent both on >> regions of layout in the "sibling"

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-26 Thread Jonathan Dann
On 24 Sep 2010, at 19:59, Martin Wierschin wrote: > when I resize the window and need to adjust the frames of both scroll > views, calling -[NSTextView setFrame:] results in the layout manager > invalidating and ensuring layout for the newly visible character range. >>> >>> Why not

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-26 Thread Jonathan Dann
On 24 Sep 2010, at 18:13, Ross Carter wrote: > >> Yeah I have line numbers views set up in all of this too, for which I have >> to set the width before I set the strings of the text views so you don't see >> the views resizing on first load if the line numbers aren't wide enough to >> accommo

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-24 Thread Douglas Davidson
On Sep 23, 2010, at 7:54 AM, Jonathan Dann wrote: > In our app, Kaleidoscope, I have 2 text views side-by-side. In one > configuration the layout of the text in each text view is dependent both on > regions of layout in the "sibling" text view, and the model objects which > represent the the i

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-24 Thread Martin Wierschin
when I resize the window and need to adjust the frames of both scroll views, calling -[NSTextView setFrame:] results in the layout manager invalidating and ensuring layout for the newly visible character range. Why not just turn off text view width/height tracking for the container during

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-24 Thread Ross Carter
> Yeah I have line numbers views set up in all of this too, for which I have to > set the width before I set the strings of the text views so you don't see the > views resizing on first load if the line numbers aren't wide enough to > accommodate the number of lines in the new string. Resizing

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-24 Thread Jonathan Dann
On 23 Sep 2010, at 23:46, Martin Wierschin wrote: >>> The problem I've had to continuously hack around is that NSTextView, in >>> conjunction with NSLayoutManager, is rather eager to get the text to >>> re-layout. >> >> Maybe, to disable layout, set the textview's textContainer to nil, then >

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-24 Thread Jonathan Dann
On 23 Sep 2010, at 23:12, Ross Carter wrote: > Maybe, to disable layout, set the textview's textContainer to nil, then > restore it to enable layout? Hi Ross, I'll give it a go. I think tricks like that may help in some of the cases I have. Thanks, Jon _

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-23 Thread Martin Wierschin
The problem I've had to continuously hack around is that NSTextView, in conjunction with NSLayoutManager, is rather eager to get the text to re-layout. Maybe, to disable layout, set the textview's textContainer to nil, then restore it to enable layout? That's one idea, though I wouldn't b

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-23 Thread Ross Carter
Maybe, to disable layout, set the textview's textContainer to nil, then restore it to enable layout? On Sep 23, 2010, at 7:54 AM, Jonathan Dann wrote: > Hi all, > > In our app, Kaleidoscope, I have 2 text views side-by-side. In one > configuration the layout of the text in each text view is d

Cocoa Text System - Temporarily Disabling Layout

2010-09-23 Thread Jonathan Dann
Hi all, In our app, Kaleidoscope, I have 2 text views side-by-side. In one configuration the layout of the text in each text view is dependent both on regions of layout in the "sibling" text view, and the model objects which represent the the insert, equal and deleted regions of the diff. The