Q: How to automatically resize a NSPanel (and NSImageView) when I set a new image? I have a NSPanel with a NSImageView. In my app this panel can contains images of different sizes, so I would like to resize both panel and image view when a new image is loaded.
Should I programmatically set new frames for both everytime I set the new image, or is there a best way to do it (maybe a setting) ?
thanks

A: You can use bindings.
For the window Content Width and Content Height, you need to set values as you get NSImage from your image. 
You need to find image.width and image.height and then use them for binding.
