Move NSPanel using Core Animation
Move NSPanel using Core Animation
- Subject: Move NSPanel using Core Animation
- From: Richard Pollock <email@hidden>
- Date: Thu, 24 Jan 2008 15:52:52 +0000
Is it possible to smoothly slide an NSPanel using Core Animation? I've
got the following code in a mouseUp: method using the animator proxy
(with the goal of having the bottom left corner of my shiny new HUD
NSPanel slide under the mouse):
[[MyNSPanel animator] setFrameOrigin:[MyNSWindow
convertBaseToScreen:NSMakePoint([event locationInWindow].x,[event
locationInWindow].y)]]
With this code, the panel does move, but doesn't *animate* to its new
location. I've searched various places around the net but have only
come up with documentation/code for moving NSViews rather than
NSWindows. Most of these NSView movements seem to use setFrame: with a
modified NSRect origin, but surely that's effectively what
setFrameOrigin: is doing to my panel?
(Incidentally, core animation is "working" on the panel, as I've been
able to successfully fade it in and out using [[MyNSPanel animator]
alpha:x])
Is there perhaps something obvious I'm missing here, like certain
window style masks needing to be set or specific window ordering/key
status?
Thanks,
Rich
_______________________________________________
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