setting NSScrollView content width to NSText width
setting NSScrollView content width to NSText width
- Subject: setting NSScrollView content width to NSText width
- From: David Alter <email@hidden>
- Date: Tue, 16 Mar 2010 13:15:27 -0700
I dynamically create a NSScrollView and place and NSTextView inside of it. I
want the width of the content view to expand with the text. Basically the
same way the xCode editor works. The horizontal scroll bar adjusts as texts
is added. The width of the content view is the width of the longest line of
texts in NSTextView. There does not appear to be a simple way to set this
for the NSScrollView. I can adjust the width on the frame of my NSTextView
and that will adjust my NSScrollView. Is that the recommended way of doing
this? If that is, then is there an easy way to get the Width of the longest
line of text in the NSTextView?
thanks for the help
-dave
_______________________________________________
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