On Jul 17, 2009, at 5:38 PM, James Walker wrote:

Is there a way to have an NSTextView that is not enclosed in an
NSScrollView?  IB doesn't seem to want to let me.  It would be for
displaying static rich text (certain things are harder, or maybe even
impossible, to do with NSTextField).  I know I can turn off drawing of
the NSScrollView border, but it throws off the layout, because there's a
margin around the text, at least on the left.

I do this in an app I am working on. I do *not* create the NSTextView in IB, but rather do so programmatically. You'll need to call its - initWithFrame method to initialize, and then add as a subview to its containing view. I also interact directly with the underlying text system (Text Container, Layout Manager, and Text Storage) in order to set the text, determine the size of the laid out text, and position for presentation and interaction. Getting all that to work took me a fair amount of exploration and reading of the relevant class documentation and other text-related information provided by Apple. _______________________________________________

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