Re: layoutManager:didCompleteLayoutForTextContainer:atEnd: and multi-column problem
Re: layoutManager:didCompleteLayoutForTextContainer:atEnd: and multi-column problem
- Subject: Re: layoutManager:didCompleteLayoutForTextContainer:atEnd: and multi-column problem
- From: "Martin" <email@hidden>
- Date: Mon, 03 Apr 2006 18:23:21 -0700
Hi Keith,
>2) If there are several columns of text and you select
>all, then hit delete, the text is deleted but the
>columns remain. This is a bug in TextEdit too
We got around this in our NSLayoutManager subclass. Specifically, in the "textStorage:edited:range:etc" method, we have some code that basically does this:
unsigned lim = [storage length];
if( range.location == lim ) {
if( 0 == lim ) {
NSTextContainer* tc = [[self firstTextView] textContainer];
if( nil != tc ) [[self delegate] layoutManager:self didCompleteLayoutForTextContainer:tc atEnd:YES];
}
else {
[self invalidateLayoutForCharacterRange:NSMakeRange(lim - 1, 1) isSoft:YES actualCharacterRange:NULL];
}
}
Cheers,
~Martin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden