[solved] Re: NSTextView auto scroll up behaviour
[solved] Re: NSTextView auto scroll up behaviour
- Subject: [solved] Re: NSTextView auto scroll up behaviour
- From: Satoshi Matsumoto <email@hidden>
- Date: Wed, 31 Aug 2005 14:22:10 +0900
on 05.8.31 1:24 PM, Satoshi Matsumoto at email@hidden wrote:
> I think the key is how to customize the auto-resizing of NSTextView frame in
> order to resize by more lines than the actual increased text lines.
Yes! I found a solution from above my comment :-).
The answer is simple.
Override -setFrameSize: in the NSSTextView subclass.
- (void)setFrameSize:(NSSize)newSize;
{
int margin = [[[self enclosingScrollView] contentView] frame].size.height/2;
newSize.width = (int)newSize.width;
newSize.height = (int)newSize.height+margin;
[super setFrameSize:newSize];
}
This will bring the half window height auto-scroll up when a new line
appended at the end of the document.
Satoshi
-----------------------------------------------------
Satoshi Matsumoto <email@hidden>
816-5 Odake, Odawara, Kanagawa, Japan 256-0802
_______________________________________________
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