• 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
Resizing subviews within NSSplitView programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Resizing subviews within NSSplitView programmatically


  • Subject: Resizing subviews within NSSplitView programmatically
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Fri, 5 Nov 2004 17:32:10 -0800

Greetings:
I managed to create & stack two sub-views {NSImageView & NSTextView} within a NSSplitView per NSTabViewItem. However, the 2nd sub-view 'NSTextView' fills the entire parent view, squishing the first view {NSImageView}. The user would have to manually move he horizontal bar down to expose the first view.

Question: How can I programmatically adjust the two views so the user can actually see sub-view#1? The initial exposure doesn't need to be 50/50%. In fact, it's preferable to have a 75/25% exposure, with the 25% going to the descriptive NSTextView sub-view.

I've tried doing [<subView> setFrame:<NSRect>] and even the setBounds. But that didn't work.

The following is a snippet of NSTabViewItem #2:


if (!mapImage2_View)
mapImage2_View = [[NSImageView alloc] init];


[mapImage2_View setImage:theImage]; // NSImageView


theItem = [map_TabView tabViewItemAtIndex:1];


[theSplitView addSubview:mapImage2_View];


[tabMemo2_View insertText:@"Insert text here."];
NSSize theSize;
theSize.width = 661; theSize.height = 148;
theFrame.size = theSize;
[tabMemo2_View setBounds:theFrame];


[theSplitView addSubview:tabMemo1_View];


[theItem setView:theSplitView];
[mapImage2_View setNeedsDisplay]; // ...this line is useless.
[theItem setLabel:@"Two"];



Regards,
Ric.
 _______________________________________________
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: Resizing subviews within NSSplitView programmatically
      • From: Ken Ferry <email@hidden>
  • Prev by Date: [SOLVED] NSArrayController bound to NSUserDefaultsController
  • Next by Date: Book about creating Cocoa widgets
  • Previous by thread: [SOLVED] NSArrayController bound to NSUserDefaultsController
  • Next by thread: Re: Resizing subviews within NSSplitView programmatically
  • Index(es):
    • Date
    • Thread