NSSplitView not resizing evenly
NSSplitView not resizing evenly
- Subject: NSSplitView not resizing evenly
- From: Mitch Murphy <email@hidden>
- Date: Sun, 8 Jan 2006 01:55:59 -0500
hi,
i'm having problems with the adjustSubviews method of NSSplitView. i
get a "recursive" split instead of an even split, ie. for 4 subviews ...
i want 1/4, 1/4, 1/4, 1/4, but i get 1/2, 1/4, 1/8, 1/16.
do i need to set all the textView's frames manually (yuck) ?
Mitch
===================
- (IBAction)updateSplitView:(id)sender {
int i;
for( i=0 ; i<8 ; i++ )
[logViews[i] removeFromSuperview];
for( i=0 ; i<8 ; i++ )
if( [segmentedControl isSelectedForSegment: i] )
[self addLogView: i];
else
[self removeLogView: i];
[splitView adjustSubviews];
[self refresh: self];
}
- (void) addLogView: (int) segmentIndex {
if( logViews[segmentIndex] == nil ) {
NSScrollView *scrollview = [[NSScrollView alloc] initWithFrame:
[splitView frame]];
[scrollview setBorderType:NSNoBorder];
[scrollview setHasVerticalScroller:YES];
[scrollview setHasHorizontalScroller:NO];
//[scrollview setAutoresizingMask:NSViewWidthSizable |
NSViewHeightSizable];
NSTextView *textView = [[NSTextView alloc] initWithFrame:
[scrollview frame]];
[scrollview setDocumentView:textView];
logViews[segmentIndex] = scrollview;
}
[splitView addSubview: logViews[segmentIndex]];
}
- (void) removeLogView: (int) segmentIndex {
logViews[segmentIndex] = nil;
}
_______________________________________________
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