Ideal size of an NSScrollView?
Ideal size of an NSScrollView?
- Subject: Ideal size of an NSScrollView?
- From: John Stiles <email@hidden>
- Date: Mon, 19 Dec 2005 19:02:13 -0800
I have a regular NSTextView inside an NSScrollView (with an auto-
hiding vertical scroll bar). The contents of the text view are set
via code depending on the outcome of some operations. The scroll view
is set up to grow as my window is resized. So far, everything is
working great.
Now, I'd like to be able to determine how large the NSTextView ought
to be to avoid scrolling. That way, I can set the window to its
"optimal" size before showing it--just big enough to show the text,
without having a ton of extra white space.
Is there an easy way to do this?
(I tried gradually growing the window until [scrollView
hasVerticalScroller] returned NO, but that didn't work; apparently it
returns YES even if the scroller is hidden. I also tried looking at
the contentSize and documentVisibleRect but it didn't seem to do what
I wanted.)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden