Re: NSTextView without NSScrollView
Re: NSTextView without NSScrollView
- Subject: Re: NSTextView without NSScrollView
- From: Stuart Malin <email@hidden>
- Date: Sat, 18 Jul 2009 08:25:16 -0700
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@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