Re: Text layout responsibility

2008-12-15 Thread Rimas
I have tried to modify my text container in mentioned method (- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag). At a first glance looks like this works. But I decided to stay on the earlier way

Re: Text layout responsibility

2008-12-15 Thread Rimas
Hello Gordon, Have you installed 10.6 to run test? Regards, Rimas >NSTextContainer has been broken for some time now and I can't even get > an acknowledgement from DTS of the bug in spite of the fact that I've had > others verify it on independent machines using Apple, Inc's own sample code.

Re: Text layout responsibility

2008-12-12 Thread Martin Wierschin
Try changing the container size once the layout is complete, you can do this by using the delegate method: - (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag and checking the layoutFinishedF

Re: Text layout responsibility

2008-12-12 Thread Gordon Apple
I didn't attach the quotes because I just wanted to make a point: NSTextContainer has been broken for some time now and I can't even get an acknowledgement from DTS of the bug in spite of the fact that I've had others verify it on independent machines using Apple, Inc's own sample code. I'

Re: Text layout responsibility

2008-12-12 Thread Rimas
Thank you for the tip. I'll try this also. Rimas M. On Fri, Dec 12, 2008 at 1:18 PM, chaitanya pandit wrote: > Try changing the container size once the layout is complete, you can do this > by using the delegate method: > - (void)layoutManager:(NSLayoutManager *)layoutManager > didCompleteLayout

Re: Text layout responsibility

2008-12-12 Thread chaitanya pandit
Try changing the container size once the layout is complete, you can do this by using the delegate method: - (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag and checking the layoutFinishedF

Re: Text layout responsibility

2008-12-12 Thread Rimas
> My first suspicion was wrong, but I think you're experiencing a similarly > touchy aspect of NSLayoutManager. > > I believe the problem is that the NSLayoutManager attached to the text > storage might not have been notified of the edit before you get the > notification. So when you change the con

Re: Text layout responsibility

2008-12-12 Thread Martin Wierschin
Rimas, My first suspicion was wrong, but I think you're experiencing a similarly touchy aspect of NSLayoutManager. I believe the problem is that the NSLayoutManager attached to the text storage might not have been notified of the edit before you get the notification. So when you change th

Re: Text layout responsibility

2008-12-12 Thread Rimas
> My suspicion is that you are > modifying the contents of the NSTextStorage or changing the NSTextContainer > geometry in response to a layout event. You cannot safely do either while > layout is active on the stack. Here is the stack: #0 0x92811e17 in objc_exception_throw #1 0x9071bf2

Re: Text layout responsibility

2008-12-12 Thread Martin Wierschin
Can you post the full stack backtrace for the exception? #0 0x92811e17 in objc_exception_throw #1 0x9071bf2b in +[NSException raise:format:arguments:] #2 0x9071bf6a in +[NSException raise:format:] #3 0x934598cc in _NSBlockNumberForIndex #4 0x93462baf in -[NSLayoutManager

Re: Re: Text layout responsibility

2008-12-12 Thread Rimas
Hello Martin, Thank you for your response. > The text container isn't really responsible for that. It's job is to merely > define the geometric space available for text. I would expect you'll find it > easier to override NSTypesetter's > "willSetLineFragmentRect:forGlyphRange:etc:" method. I wil

Re: Text layout responsibility

2008-12-11 Thread Martin Wierschin
Hello Rimas, I am trying to implement editable text view which changes text position (paragraphs positions, to be exact) according to the some text attributes. I know, that NSTextContainer is responsible for line rects calculation when text should be placed in known shape. Is it responsib