1

I want to do what is described here. I know I am kinda repeating the question but that post does not have an answer. I have searched the net and didn't find anything I could understand either.

So, here is my problem: I want to create an NSTextField subclass that animates text (in the way described by the other post) when the text is too long to be completely displayed. I have absolutely no idea on how to do this, so some sample code would be nice for complicated answers. If it helps, I only want to use this to animate labels (text not selectable nor editable). Thanks.

Community
  • 1
  • 1
Alex
  • 5,009
  • 3
  • 39
  • 73
  • You can take a look at [this SO entry](http://stackoverflow.com/questions/3232801/itunes-song-title-scrolling-in-cocoa). It is not based on a [NSTextField](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSTextField_Class/Reference/Reference.html) but on a [NSView](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/Reference/NSView.html), but the result is the same. – Laurent Etiemble Nov 03 '11 at 15:01
  • @LaurentEtiemble Awesome! That is exactly what I needed. All I need now is to modify the code a little bit and clean it. Please post as an answer so you can receive the bounty. – Alex Nov 03 '11 at 16:18

2 Answers2

1

It seems that this SO entry is close to what you need. It is not based on a NSTextField but on a NSView, but the result is what you are looking for and it should note be hard to modify.

Community
  • 1
  • 1
Laurent Etiemble
  • 27,111
  • 5
  • 56
  • 81
0

Those links should show you the way :

Making uitextview scroll programmatically

Auto Scrolling UITextView Problem

They talk about iPhone classes, but I'm sure you will be able to adapt them for NSTextField.

Community
  • 1
  • 1
Oliver
  • 23,072
  • 33
  • 138
  • 230