Vertically scrolling text in multiline label

Hello,

I’d like to have a multiline label that is physically big enough to accommodate around 10 lines of text, but continuously scrolls, pushing “old” lines of text up, and keeping the newest line of text visible at the bottom of the label. The label is updated with a new line every second or so from a NSTask. I’ve tried messing around with some of the settings for the label in interface builder with no luck. I also found some examples of animating text on this forum, but that seems a bit excessive. Hopefully, there’s a much simpler way to accomplish this. In case I’m making no sense at all, here’s a link to some “movie credits” style scrolling I’m looking to recreate in my multiline label.

http://www.jdstiles.com/java/credits.html (click on the “See credits for My site!” link)

Thanks in advance for your assistance!

Hi,

I’d recommend to use an NSTextView object instead of a multiline label and call scrollRangeToVisible of the textview after appending a new line

Thanks for the suggestion Stefan! Do you recommend using NSTextView instead because this isnt possible with a multi line label or some other reason?

NSTextField does not respond to scrollRangeToVisible so you need a workaround like an animation to perform the scrolling