1783 |
editor: (NSText*)textObject |
editor: (NSText*)textObject |
1784 |
{ |
{ |
1785 |
NSRect titleRect = [self titleRectForBounds: aRect]; |
NSRect titleRect = [self titleRectForBounds: aRect]; |
1786 |
NSSize maxSize = NSMakeSize(1e8, titleRect.size.height); |
/* See comments in NSStringDrawing.m about the choice of maximum size. */ |
1787 |
|
NSSize maxSize = NSMakeSize(1e6, titleRect.size.height); |
1788 |
NSClipView *cv = [[NSClipView alloc] |
NSClipView *cv = [[NSClipView alloc] |
1789 |
initWithFrame: titleRect]; |
initWithFrame: titleRect]; |
1790 |
NSTextContainer *ct = [(NSTextView*)textObject textContainer]; |
NSTextContainer *ct = [(NSTextView*)textObject textContainer]; |
1793 |
RELEASE(cv); |
RELEASE(cv); |
1794 |
[cv setAutoresizesSubviews: NO]; |
[cv setAutoresizesSubviews: NO]; |
1795 |
[cv setDocumentView: textObject]; |
[cv setDocumentView: textObject]; |
1796 |
[textObject setFrame: [cv bounds]]; |
[textObject setFrame: NSMakeRect(0, 0, maxSize.width, maxSize.height)]; |
1797 |
[textObject setHorizontallyResizable: YES]; |
[textObject setHorizontallyResizable: NO]; |
1798 |
[textObject setVerticallyResizable: NO]; |
[textObject setVerticallyResizable: NO]; |
1799 |
[textObject setMaxSize: maxSize]; |
[textObject setMaxSize: maxSize]; |
1800 |
[textObject setMinSize: titleRect.size]; |
[textObject setMinSize: titleRect.size]; |