• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Ideal size of an NSScrollView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Ideal size of an NSScrollView?
      • From: John Stiles <email@hidden>
    • Re: Ideal size of an NSScrollView?
      • From: Jerry Krinock <email@hidden>
References: 
 >create a view without IB (From: Andrea Salomoni <email@hidden>)
 >Re: create a view without IB (From: Shawn Erickson <email@hidden>)
 >Re: create a view without IB (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: XCode and subversion
  • Next by Date: Re: NSWindowDidBecomeKeyNotification equivalent for NSView?
  • Previous by thread: Re: create a view without IB
  • Next by thread: Re: Ideal size of an NSScrollView?
  • Index(es):
    • Date
    • Thread