Small improvements to allow changing of the text container for a text

view.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29648 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2010-02-15 17:04:17 +00:00
parent 4f02b08fb2
commit c9d1292563
4 changed files with 21 additions and 6 deletions

View file

@ -1142,13 +1142,16 @@ to this method from the text container or layout manager.
[self _updateMultipleTextViews];
}
- (void) replaceTextContainer: (NSTextContainer *)newContainer
{
NSLog(@"TODO! [NSTextView -replaceTextContainer:] isn't implemented");
NSLayoutManager *lm = RETAIN(_layoutManager);
unsigned int index = [[lm textContainers] indexOfObject: _textContainer];
[_textContainer setTextView: nil];
[lm removeTextContainerAtIndex: index];
[lm insertTextContainer: newContainer atIndex: index];
[newContainer setTextView: self];
RELEASE(lm);
}
- (NSTextContainer *) textContainer