• 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
Re: NSScrollView "autoscroll" while adding data?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSScrollView "autoscroll" while adding data?


  • Subject: Re: NSScrollView "autoscroll" while adding data?
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 20 Apr 2008 19:12:42 -0700


On 20 Apr '08, at 5:38 PM, Jack Repenning wrote:

I confess what I actually want is a bit more complicated than always positioning at the bottom: if the user has moved the thumb about, then the user's chosen position should win; it's only if the thumb is bottomed at the moment I add the next line that I would "autoscroll." I suspect some further subtleties lurk in the neighborhood of the transition out of "not enough data even to fill one screen full." This seems familiar enough, and subtle enough, that surely it must be hiding in the library somewhere? I don't have to reinvent this wheel, do I? Because I went lookin' for the pieces to do that, and came up dry there as well!

You have to implement it yourself.

1. Before appending text, check the view's vertical scroller to see if it's at the bottom.
2. Append the text.
3. If the scroller used to be at the end, scroll to the bottom by getting the coordinates of the bottom of the view and telling the view to scroll to there by calling scrollRectToVisible:.


—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: NSScrollView "autoscroll" while adding data?
      • From: Nathan Kinsinger <email@hidden>
References: 
 >NSScrollView "autoscroll" while adding data? (From: Jack Repenning <email@hidden>)

  • Prev by Date: Re: Passing a C String as an argument
  • Next by Date: Re: NSScrollView "autoscroll" while adding data?
  • Previous by thread: NSScrollView "autoscroll" while adding data?
  • Next by thread: Re: NSScrollView "autoscroll" while adding data?
  • Index(es):
    • Date
    • Thread