• 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
NSSplitView not resizing evenly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: Re: NSArrayController insertObject:atArrangedObjectIndex: not working as expected
  • Next by Date: Re: is this string styled?
  • Previous by thread: Radix Class, A Request for Advice
  • Next by thread: Saving an AppleScript that targets my own application
  • Index(es):
    • Date
    • Thread