• 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
Re: setting minimum size for NSView to display all content without scroll view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting minimum size for NSView to display all content without scroll view


  • Subject: Re: setting minimum size for NSView to display all content without scroll view
  • From: Warwick Hall <email@hidden>
  • Date: Sun, 29 Apr 2007 06:45:23 +1000

it is a webview and webview does not use the usual addSubview method to build its contents, so it is hard to get the HTML subviews in order to get their sizeToFit's and i want to rip my hair out!

On 27/04/2007, at 8:44 PM, I. Savant wrote:

On Apr 27, 2007, at 4:11 AM, Warwick Hall wrote:
can someone please explain to me how to set a view's minimum required size (bounds) to display all its contents?

You'd have to write your own method to do this - usually named "- sizeToFit" as in NSBox, NSControl, NSText, etc. If your view contains subviews, then your "sizeToFit" method might iterate through them all, using NSUnionRect() to keep adding up all their frames. Then you can adjust your "container" view accordingly.


If you're doing custom drawing, etc. then you should already know the metrics of all your graphical elements since you had to determine where to draw them in the first place.

It entirely depends on what your view contains and how it's built. Without further details, it's hard to make a solid suggestion.

--
I.S.





_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: setting minimum size for NSView to display all content without scroll view
      • From: "I. Savant" <email@hidden>
References: 
 >setting minimum size for NSView to display all content without scroll view (From: Warwick Hall <email@hidden>)
 >Re: setting minimum size for NSView to display all content without scroll view (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Memory management/freeing with delegate methods
  • Next by Date: Re: setting minimum size for NSView to display all content without scroll view
  • Previous by thread: Re: setting minimum size for NSView to display all content without scroll view
  • Next by thread: Re: setting minimum size for NSView to display all content without scroll view
  • Index(es):
    • Date
    • Thread