setNeedsDisplay oddity?
setNeedsDisplay oddity?
- Subject: setNeedsDisplay oddity?
- From: Timothy Reaves <email@hidden>
- Date: Sat, 10 Dec 2005 15:55:47 -0500
Hello.
I just spent some time trouble shooting a problem I had with a
custom NSView. This view allowed the user to add and remove sub-
views. When sub-views were added, the view displayed correctly.
When sub-views were removed, the view almost displayed correctly.
What would happen is that the sub-views were added to the custom
view from bottom to top, with the sub-views moving up one position to
make room for the new sub-view. When one was removed, it was removed
from the bottom, and the sub-views would slide down. The top sub-
view would slide down correctly, but a 'ghost' sub-view was left in
the original location. It was the same sub-view, but the controls on
it were non-interactive.
I was calling setNeedsDispaly:YES on the custom view. To worked
great for adding sub-views to the custom view. But not for removing
them. What I ended up doing was calling setNeedsDisplay:YES on the
custom views superView.
So my question is, why is it that when the custom view's size
increases, the superView sees this and knows that it must redraw
itself also, but when the custom view is made smaller, the superView
does not see that it needs to redraw itself?
Thanks.
_______________________________________________
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