Re: NSTextView + other NSView in NSScrollView?
Re: NSTextView + other NSView in NSScrollView?
- Subject: Re: NSTextView + other NSView in NSScrollView?
- From: Omar Qazi <email@hidden>
- Date: Sun, 27 Jul 2008 21:52:00 -0700
Putting two views inside a scroll view seems like a weird way to go
about this. What I would do is create a custom NSView subclass that
draws information at the top and has an NSTextView as a subview drawn
underneath.
Omar Qazi
Hello, Galaxy!
1.310.294.1593
On Jul 27, 2008, at 8:31 PM, Jacob Bandes-Storch wrote:
I'm trying to create a Mail-style scroll view, with a view for
information (like the view for message headers) above a text view
for the content. I created two NSViews in Interface Builder, changed
the class of the bottom one to NSTextView, selected both, and
clicked Layout > Embed Objects In > Scroll View.
This all works (it puts the views inside a scroll view), but the
NSTextView doesn't play well with the scroll view when it increases
in size, and when the scroll view changes size. When the text view
increases in size, instead of just getting longer by a line, it gets
longer and moves down, and the scroll view doesn't enable the
scrollbar. If I shrink the scroll view by means of resizing the
window (and I do have the autosizing set properly), the text view
moves up erratically, and doesn't move back down when I increase the
window size again.
Everything works just fine when I create an NSTextView and embed it
in a scroll view without another view alongside... because the
NSTextView itself becomes the scroll view's "document view".
So... what's the right way to go about doing this? Should I even try
to be putting 2 views in a scroll view for the effect I'm aiming
for? Thanks in advance.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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