Mac Resizable webview with fixed minimum size.

Marimuthu

macrumors member
Original poster
Oct 18, 2010
43
0
Hi All,

I am developing an Web based application where I load an URL onto a webview successfully.

I derive my webview class from NSWindowController class and register the webview delegates and implement methods in the derived class to receive the various web related notifications. The web page loads as expected and I am able to resize the webview to any size.

Is it possible to specify a pre-defined minimum size to the Webview such that a user must not be able resize the view below this fixed size ? However should be able to resize the view to any larger view.
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
  1. Open the .xib containing your window
  2. Select your window (not the web view in your window)
  3. Show the size inspector
  4. Tick minimum size under Constraints
  5. Enter a minimum width and height in pixels.
 

Marimuthu

macrumors member
Original poster
Oct 18, 2010
43
0
Hi All,

I have observed that when I resize the webview window to some larger window size(from it's initial default fixed size), if I were to exit the application and launch my app again, the resized view is shown.

Is there a mechanism by which I limit the resizing of the webview only to that application session i.e, If the app is exited and launched again, the webview displayed must be it's initial default size (and not the resized size).
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
  1. Open the .xib containing your window
  2. Select your window (not the web view in your window)
  3. Show the Attributes Inspector
  4. Untick Restorable under Behavior

You may have to delete your apps preferences file under ~/Library/Preferences as well.
 

Marimuthu

macrumors member
Original poster
Oct 18, 2010
43
0
Hi jiminaus,

I am actually loading the webView onto an NSPanel. There too, i was not able to find this "Untick Restorable under Behavior" setting that you are referring to.

What am I doing wrong here? I have attached the screenshot of Attribute Inspector setting for your kind reference.
 

Attachments

Marimuthu

macrumors member
Original poster
Oct 18, 2010
43
0
Could you please provide the API equivalent of this setting? I could use the same in my code in awakeForNib.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.