Re: Strange NSView Redraw issue
Re: Strange NSView Redraw issue
- Subject: Re: Strange NSView Redraw issue
- From: Andrew Madsen <email@hidden>
- Date: Sun, 7 Jan 2007 12:07:04 -0700
On Jan 7, 2007, at 9:36 AM, Matt Neuburg wrote:
On Sat, 6 Jan 2007 23:01:42 -0700, Andrew Madsen
<email@hidden> said:
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:
// SNIP
[activeContentView setNeedsDisplay: YES];
[view setNeedsDisplay: YES];
If you tell the window to display (instead of setNeedsDisplay),
does that
make a difference?
m.
No that didn't make a difference, but thanks for the suggestion.
I had a similar problem after testing exactly the same code, I solved
this by skipping the IB-line, i.e.:
// 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];
Then everything worked fine. Not sure what that fix is supposed to do
though, so I may skip something important, but it seems to be a
working solution.
Thanks, that seems to have fixed it. I too wonder why he put that
line in there. The comment suggests that he thought there was a good
reason for it, but taking it out doesn't seem to have caused any
problems.
Thanks to both of you,
Andrew
_______________________________________________
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