Re: How to make NSWindow redraw vacated rects "ifNeeded"?
Re: How to make NSWindow redraw vacated rects "ifNeeded"?
- Subject: Re: How to make NSWindow redraw vacated rects "ifNeeded"?
- From: Jerry Krinock <email@hidden>
- Date: Mon, 9 Apr 2007 10:15:15 -0700
On 2007 Apr, 08, at 20:23, Andrew Farmer wrote:
Hang on a second. I just tried to replicate your problem and had no
issues whatsoever with the much simpler
<code>
Thanks again, Andrew. Yes, indeed your code works. The significant
change you made is to move the -orderFront so that it executes
^after^ the box has been moved. But the concise demo code which I
posted was a little oversimplified. My actual application is to show
the window with a view in one location, then later, move it. This is
necessary, for example, if an NSTextField located above a button must
expand to show more text. The NSTextField itself becomes higher, and
the button must move down to make room. So, I need to -orderFront
before moving the the subview.
Unless you're writing an NSView subclass, you should never have to
issue redraws yourself. In fact, I'm pretty sure that display,
displayIfNeeded, and displayInRect should only get called from
within AppKit, and setNeedsRedisplay and setNeedsDisplayInRect
should only get called by views on themselves.
Way back 18 hours ago, that was one of the first things I tried:
Sending -setNeedsDisplay to the box ^before^ I moved it, moving it,
and then sending the message again ^after^ I moved it, but the first
message was had no effect. Apparently, when the parent NSView marks
a subview as needing display, it does not get a snapshot of the
subview's current frame.
_______________________________________________
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