• 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] Issues with garbage drawings after resizing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[NSSplitView] Issues with garbage drawings after resizing


  • Subject: [NSSplitView] Issues with garbage drawings after resizing
  • From: Stéphane Sudre <email@hidden>
  • Date: Thu, 21 Nov 2002 17:39:18 +0100

I have a NSSplitView (SV2) within a NSSplitView (SV1). The view hierarchy and organization is the following:


+---------------+------------------------------+
| N H |
| S H |
| O H NSTableView |
| u H |
| t H |
| l H |
| i +==============================+ Horizontal Splitter (SV2)
| n H |
| e H |
| V H NSBox |
| i H |
| e H |
| w H |
+---------------+------------------------------+

^
|

Vertical Splitter (SV1)

The NSBox is filled with NSTextField and NSButton widgets.

The SV2 SplitView is delegating - (void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize.

The issue is that when I resize the window containing SV1, the SV2 is correctly setting the dimension of NSTableView and NSBox but the content of NSBox is drawn with some garbages:

TextFields are seen twice with an offset.

[Question] Is there a solution to avoid this garbage?

Bonus question: I have another issue with NSSplitView when it comes to changing SV2 to another view, then resizing this view, and then putting back SV2. There is some garbage drawing from the other view (! SV2) between TextFields, in the divider rect, etc...

I tried adding some setNeedsDisplay, but it's not changing anything.

The code I'm using to constraint the resizing of SV2 is:

- (void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize
{
if (sender==IBverticalSplitView_)
{
float tWidth=oldSize.width;
NSArray * tChildren;
float tHeight=oldSize.height;
NSView * tView;

tChildren=[sender subviews];

tView=[tChildren objectAtIndex:1];

if ([sender isSubviewCollapsed:tView]==YES)
{
tView=[tChildren objectAtIndex:0];

[tView setFrame:NSMakeRect(0,0,tWidth, tHeight-[sender dividerThickness])];
}
else
{
[tView setFrame:NSMakeRect(0,tHeight-157,tWidth,157)];

tView=[tChildren objectAtIndex:0];

[tView setFrame:NSMakeRect(0,0,tWidth, tHeight-(157+[sender dividerThickness]))];
}
}
else
{
[sender adjustSubviews];
}

[sender setNeedsDisplay:YES];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • [Solved] Re: [NSSplitView] Issues with garbage drawings after resizing
      • From: Stéphane Sudre <email@hidden>
  • Prev by Date: Re: Address Book API - Person vs Company
  • Next by Date: NSView resizing problem
  • Previous by thread: Re: tableView's scroller doesn't activate
  • Next by thread: [Solved] Re: [NSSplitView] Issues with garbage drawings after resizing
  • Index(es):
    • Date
    • Thread