Strange NSView Redraw issue
Strange NSView Redraw issue
- Subject: Strange NSView Redraw issue
- From: Andrew Madsen <email@hidden>
- Date: Sat, 6 Jan 2007 23:01:42 -0700
I've got a preferences window based on the example here: http://
johndevor.wordpress.com/2006/12/24/simple-preferences/ .
For some reason, my general preferences pane (which is the biggest of
the panes) doesn't properly redraw. When switching to the general
pane from another pane, it seems as though only the portion of the
general pane's view that would have been "within" the rect defined by
the previous pane is drawn. Here is the code I'm using:
-(void) setActiveView: (id) view animate: (BOOL) flag
{
NSRect windowFrame = [[self window] frame];
windowFrame.size.height = [view frame].size.height +
WINDOW_TITLE_HEIGHT;
windowFrame.size.width = [view frame].size.width;
windowFrame.origin.y = NSMaxY([[self window] frame]) - ([view
frame].size.height + WINDOW_TITLE_HEIGHT);
if ([[activeContentView subviews] count] != 0)
[[[activeContentView subviews] objectAtIndex:0] removeFromSuperview];
[[self window] setFrame:windowFrame display:YES animate:flag];
// this seems to fix an IB problem with resizing during the
animation...
[activeContentView setFrame:NSMakeRect(0, 0, NSWidth([[self window]
frame]), NSMinY([[self window] frame]))];
[activeContentView addSubview:view];
[[self window] update];
[activeContentView setNeedsDisplay: YES];
[view setNeedsDisplay: YES];
}
Any ideas? For some reason it works fine most of the time on my
Intel iMac, but on my PowerBook, the problem occurs 100% of the time.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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