Sorry, I didn't post code because it was in Pascal, but it's easy enough to read (remember the old Inside Macintosh books?). I could re- write in Objective-C if anyone needed...

setMaxSize: and setWidthTracksTextView: are the culprits here and simply reversing them doesn't work because I don't which "max size" would correspond to "wrapping". Thanks for helping.

The code:

   textView.setHorizontallyResizable(true);
   layoutSize := textView.maxSize;
   layoutSize.width := layoutSize.height;

   textView.setMaxSize(layoutSize);
   textView.textContainer.setWidthTracksTextView(false);
   textView.textContainer.setContainerSize(layoutSize);

On Apr 28, 2009, at 6:55 AM, Martin Wierschin wrote:

After reading through the archives I learned how to turn off word wrapping in NSTextView by calling a few methods in both NSText and NSTextContainer but calling them in reverse order (reverting the effect) did not restore word wrapping properly.

In particular I think the problem is setContainerSize. If I set it to a fixed width, text is wrapped but I would like it to follow the view bounds like it did originally. Is there a meta-value or something else I need to give it?

I suppose you've called setWidthTracksTextView: and setHeightTracksTextView: as needed? If you post your code it would be easier to help you.

~Martin


Regards,
        Josef

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to