• 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
Strange resizing issue with NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange resizing issue with NSView


  • Subject: Strange resizing issue with NSView
  • From: John Stiles <email@hidden>
  • Date: Mon, 30 Jan 2006 16:43:52 -0800

I have written some code which adds a WebView inside an NSBox.
It's pretty simple. In the following code, HTMLSheetWebContainer is an NSBox in my nib, and HTMLSheetWebView is a WebView*.
The code goes like this:


NSRect bounds = [HTMLSheetWebContainer bounds];
// If I don't inset the bounds by 2 pixels, the box lines cover up the edges of the web view.
bounds.size.height -= 2.0;
bounds.size.width -= 2.0;
HTMLSheetWebView = [[WebView alloc] initWithFrame:bounds frameName:NULL groupName:NULL];
[HTMLSheetWebContainer addSubview:HTMLSheetWebView];
[HTMLSheetWebView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];



Despite setting the auto-resize mask, I found that the web view would not resize no matter what I did. I added a call to [HTMLSheetWebContainer setAutoresizesSubviews:YES] but that was ineffective.
After a bit of head-scratching and debugging, I realized that if I added any resizing object inside the NSBox in my nib, suddenly the web-view started resizing too. I can't explain why that worked, but it did. I ended up adding a tiny Custom View to the bottom corner of my NSBox, and all seemed to be well.
Is this a bug in the NSView system or am I missing something?


_______________________________________________
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: Strange resizing issue with NSView
      • From: Daniel Jalkut <email@hidden>
  • Prev by Date: Re: multiple iSight stream same time?
  • Next by Date: Re: I think I have found a big bug in NSBrowser
  • Previous by thread: Re: Collapse NSSplitView pane programatically
  • Next by thread: Re: Strange resizing issue with NSView
  • Index(es):
    • Date
    • Thread