Resizing subviews within NSSplitView programmatically
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