• 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
splitView not rendering correctly - where am I wrong ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

splitView not rendering correctly - where am I wrong ?


  • Subject: splitView not rendering correctly - where am I wrong ?
  • From: Mario KuĆĄnjer <email@hidden>
  • Date: Thu, 16 Jul 2009 16:55:54 +0200
  • Thread-topic: splitView not rendering correctly - where am I wrong ?

Hello everyone!

So I have a little problem that I don't know how to fix so if somebody
would be kind to help and explain the solution.

Problem is that splitView displays subviews that are rendered outside from the visible area
of the window so therefore are clipped (not visible). They are clipped after the splitView
has been resized in that extend that (only right subview and/or both) subviews had been totally sized down.
When resized back up, top (of both subviews) and/or right part (of right subview) are clipped.

My guess it has something to do with bounds and/or position of subviews, but since I'm novice in Cocoa
and Objective-C I can't see the solution.

Here is the code that I'm using for displaying splitView.

Thanks in advance!
Mario

----------------------------------------------------------------------------------------------------------------------------------

- (void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize
{
 NSView *leftView = [[sender subviews] objectAtIndex:0];
 NSView *rightView = [[sender subviews] objectAtIndex:1];

 float dividerThickness = [sender dividerThickness];

 NSRect splitViewFrame = [sender frame];
 NSRect leftFrame = [leftView frame];
 NSRect rightFrame = [rightView frame];

	int	differenceInWidth  = splitViewFrame.size.width - oldSize.width;

 leftFrame.size.height = newFrame.size.height;
 leftFrame.origin = newFrame.origin;

	if (differenceInWidth < 0)
	{
		rightFrame.size.width += differenceInWidth;
	}
	else if (differenceInWidth > 0)
	{
		rightFrame.size.width += differenceInWidth;
	}

 rightFrame.size.width = splitViewFrame.size.width - leftFrame.size.width - dividerThickness;
 rightFrame.size.height = newFrame.size.height;
 rightFrame.origin.x = newFrame.origin.x + leftFrame.size.width + dividerThickness;

 [leftView setFrame:leftFrame];
 [rightView setFrame:rightFrame];

	[sender adjustSubviews];
	[sender display];
}
_______________________________________________

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: splitView not rendering correctly - where am I wrong ?
      • From: Boyd Collier <email@hidden>
    • Re: splitView not rendering correctly - where am I wrong ?
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: Windowed Video
  • Next by Date: Re: Windowed Video
  • Previous by thread: Re: Windowed Video
  • Next by thread: Re: splitView not rendering correctly - where am I wrong ?
  • Index(es):
    • Date
    • Thread