I have an NSView subclass (the view of an NSCollectionViewItem) that needs to dynamically resize in order to fully display the contents of a NSTextView that it contains. I've tried just doing this off the top of my head:

[self setFrame:NSMakeRect([self frame].origin.x, [self frame].origin.y, [self frame].size.width, [tv frame].size.height)];


Where "tv" is a reference to the text view. I'm sure I'm doing this wrong in a billion ways. I've also heard of NSTextView's sizeToFit method, but I believe that only works when the NSView's bounds are large enough to accommodate the enlarged text view, and in this case the NSView needs to be resized before I can use sizeToFit.

I basically need a way of getting the height of the text view needed to display all the text.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to