• 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
NSViewWidthSizable causing problems?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSViewWidthSizable causing problems?


  • Subject: NSViewWidthSizable causing problems?
  • From: Joanna Carter <email@hidden>
  • Date: Thu, 3 Feb 2011 08:04:44 +0000

Hi folks

I am trying to create a multi-tab NSTabView window, whose tab contents are only created when the tab is clicked on.

I have set the resizing on the tab view, in IB, to follow the size of the main form.

I have created another view, to be inserted into the NSTabViewItem, in a separate NIB and am trying to get it to resize as the parent form does.

- (void) tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem
{
  int tabViewItemIdentifier = [tabView indexOfTabViewItem:tabViewItem];

  switch (tabViewItemIdentifier)
  {
    case 0:

      if (!myViewController)
      {
        myViewController = [[MyViewController alloc] initWithNibName:@"MyView" bundle:nil];

        [tabViewItem.view addSubview:[myViewController view]];

        [tabViewItem.view setAutoresizesSubviews:YES];

        [myViewController.view setAutoresizesSubviews:YES];

        NSUInteger resizingMask = NSViewHeightSizable | NSViewWidthSizable;

        [myViewController.view setAutoresizingMask:resizingMask];

        NSRect frame = [tabViewItem.view bounds];

        [myViewController.view setFrame:frame];
      }
    …
}

The problem I have is that specifying NSViewWidthSizable as part of the resizing mask means that the parent form can no longer resize.

Have I missed something simple?

Joanna

--
Joanna Carter
Carter Consulting

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: NSViewWidthSizable causing problems? [Solved]
      • From: Joanna Carter <email@hidden>
  • Prev by Date: Re: Reusable Cells
  • Next by Date: Re: Which is the lightest way to draw images and text?
  • Previous by thread: Re: Which is the lightest way to draw images and text?
  • Next by thread: Re: NSViewWidthSizable causing problems? [Solved]
  • Index(es):
    • Date
    • Thread