• 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: How to scroll a text view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to scroll a text view


  • Subject: Re: How to scroll a text view
  • From: Joseph Kelly <email@hidden>
  • Date: Thu, 29 Sep 2005 12:25:52 -0700

Thanks! That mostly does the trick.

Is there a quick and easy way to see that what's visible is not already at the end, to suppress jumping to the end every time text gets added.

Sincerely,

joe k.

On Sep 29, 2005, at 12:05 PM, Yann Bizeul wrote:

Take a look at NSText's scrollRangeToVisible:, and specify a range of NSMakeRange([myText size]-1,1)

file:///Developer/ADC Reference Library/documentation/Cocoa/ Reference/ApplicationKit/ObjC_classic/Classes/NSText.html#// apple_ref/doc/uid/20000367-scrollRangeToVisible_

Yann Bizeul • yann at tynsoe.org
Cocoa Developer

Tynsoe Projects
BuddyPop • GeekTool • SSH Tunnel Manager • ...
http://projects.tynsoe.org/


Le 29 sept. 05 à 20:52, Joseph Kelly a écrit :


Greetings,

I am trying to implement a console-like display with scrolling behavior similar to Xcode's debug console and build windows: i.e. as text gets added to the view, and we are already at the end, it scrolls the new text into view, otherwise it just stays in the same place.

In other frameworks this is done something like:

bool atEnd = scroller->AtEnd()
textView->Append(newText)
if (atEnd)
   scroller->ScrollEndIntoView()

I see no correlate in Cocoa.

I'm using an NSTextView.

Any ideas?

Sincerely,

joe k.


_______________________________________________ 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





_______________________________________________ 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: 
 >How to scroll a text view (From: Joseph Kelly <email@hidden>)
 >Re: How to scroll a text view (From: Yann Bizeul <email@hidden>)

  • Prev by Date: Re: Mouse Motion...
  • Next by Date: Re: Mouse Motion...
  • Previous by thread: Re: How to scroll a text view
  • Next by thread: Re: How to scroll a text view
  • Index(es):
    • Date
    • Thread