Swap NSWindow positions with setFrame at the same time
Swap NSWindow positions with setFrame at the same time
- Subject: Swap NSWindow positions with setFrame at the same time
- From: Chris <email@hidden>
- Date: Sun, 14 Jan 2007 06:18:12 -0800
I have a couple of NSBorderlessWindowMask windows that need to trade
places on occasion with each-other. Doing this is rather simple, and
by using the setFrame animate to YES gives a nice bit of eye candy.
What I can't get my head around is triggering these two windows to
move as the same time. Without the animate part of setFrame,
obviously they just pop in their new place, but again the one right
after the other is distracting. I just can't think of the best way to
do this. Do I need to throw off a new thread just to two windows at
the same time?
Basic code that swaps my windows:
NSRect firstRect = [someOtherWindow frame];
NSRect nextRect = [soemWindow frame];
[someWindow setFrame:firstRect display:YES animate:NO];
[someOtherWindow setFrame:nextRect display:YES animate:NO];
A second part of this question. When the windows do move, either with
or with out the animate part, the Quartz Composition playing in the
background stops redrawing, essentially freezes in place until the
windows are done. Again, without the animate part the windows
changing places is so quick you barley notice the stutter, but if I
use the animate switch, then the background just freezes for the
animationResizeTime. I believe I read somewhere that screen updates
are stopped during the moving of windows this way. Obviously part one
is slightly more important, but I would like to use the animate part
of setFrame, so in order to do so, I need to figure this out too I
guess.
Thanks
_______________________________________________
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