• 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
[NSTextView] Scrolling to the top of the document via code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[NSTextView] Scrolling to the top of the document via code


  • Subject: [NSTextView] Scrolling to the top of the document via code
  • From: Stéphane Sudre <email@hidden>
  • Date: Sat, 24 Nov 2007 02:50:51 +0100

What's the obvious API I'm missing to scroll to the real top of a document displayed in a NSTextView?

I have a NSTextView with a TextContainer Inset set to (6.0f,6.0f).

When I replace the content of the NSTextView through its container (usual beginEditing, readFromURL, ...) code, I end up with the document not being displayed perfectly correctly. The document (if higher than the view) is scrolled bit so that the first line of text is stuck to the top of the scrollview instead of being 6 points away.

I tried to use the scrollPoint or scrollRangeVisibleSomething API with different reasonable values, give a look at the GNUStep source code, change the frame of the NSTextView and its clipview, etc. with no success.

The document is still scrolled by default by a small amount (and it's probably the TextContainer Inset height).


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: [NSBundle preferredLocalizationsFromArray:] Is the cold war really over?
  • Next by Date: Re: Large progress indicators in Leopard
  • Previous by thread: Re: [NSBundle preferredLocalizationsFromArray:] Is the cold war really over?
  • Next by thread: Determining the resident set size of current process (Under 10.5+)
  • Index(es):
    • Date
    • Thread