Setup a Scroll View With TextView (Multiline Text in Cocoa)


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # Setup a scroll view containing a text view
  2.  
  3. @scroll_view = scroll_view(:frame => [0,0,495,300], :layout => {:expand => [:height, :width]})
  4. @text_view = text_view(:frame => [0,0,490,300])
  5. @scroll_view.documentView = @text_view
  6.  
  7. #Load into the window with: win << @scroll_view
  8.  
  9. #To read/write text under the text_view, you can refer to it as @text_view.string = " Text"

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.