• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[solved] Re: NSTextView auto scroll up behaviour
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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

References: 
 >Re: NSTextView auto scroll up behaviour (From: Satoshi Matsumoto <email@hidden>)

  • Prev by Date: Re: NSKeyedArchiver - better ways to autosave documents?
  • Next by Date: Where can I find information on making my program apple scriptable?
  • Previous by thread: Re: NSTextView auto scroll up behaviour
  • Next by thread: Opening a document in code
  • Index(es):
    • Date
    • Thread