Re: Cancelling a window move
Re: Cancelling a window move
- Subject: Re: Cancelling a window move
- From: ∞ <email@hidden>
- Date: Tue, 24 Jul 2007 22:57:19 +0200
Il giorno 24/lug/07, alle ore 22:31, Brad Carter ha scritto:
- (void)windowDidMove:(NSNotification *)aNotification
{
NSLog(@"window moved notification received");
NSPoint windowPoint;
screenRect = [[NSScreen mainScreen] frame];
windowPoint.x = 0;
windowPoint.y = (screenRect.size.height - MAINWINDOWHEIGHT);
[oMainWindow setFrameOrigin:windowPoint];
}
A better approach may have the window animate back to its former
position to provide feedback that it is not movable, rather than
confuse the user by jumping back without any feedback. Mac users
understand "speeding back" as it is the same animation that happens
when you drag an object (ie a file) to a position you cannot drop it
into.
(You can find almost-ready animation code in Quinn's source code, in
my own AfloatAnimator at the Afloat open source project at Google
Code -- warning, LGPL --, or use Cocoa's NSViewAnimation or Leopard's
Core Animation.)
- ∞_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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