NSTextView resizeability and scrolling
NSTextView resizeability and scrolling
- Subject: NSTextView resizeability and scrolling
- From: Stamenkovic Florijan <email@hidden>
- Date: Tue, 08 Sep 2009 13:50:44 -0400
Hi all,
I am trying to make a user interface in which there is a view that
contains multiple subviews, one of which is an NSTextView. The parent
view should be embedded in an NSScrollView. The idea is that when the
NSTextView is typed in, and possibly resizes as a consequence, it's
parent view should resize, scroll bars should appear etc.
The effect would be similar to what you get in address book when
typing in the notes field. If the notes field gets too big, you get to
scroll all of the contact info, not only the view. Googling indicates
however that this is done differently, I am not searching for a way to
imitate this exact behavior, just using it as an example of what I
want to achieve visually.
I've googled for a solution, found nothing. I tried making it by
observing the NSViewFrameChangedNotification of the NSTextView from
it's parent, and resizing, but this is more tricky then I imagined.
As as side question, it seems that an NSTextView has some margins that
separate the text from it's outer edges. This makes sense when the
NSTextView is in an NSScrollView, but makes it difficult to align the
text view when it is not. I can't find any documented API on
controlling this. Is it possible?
Perhaps I am going about this the wrong way. I am open to suggestions
on how to accomplish this some other way.
TIA,
F
_______________________________________________
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