Re: Move NSPanel using Core Animation
Re: Move NSPanel using Core Animation
- Subject: Re: Move NSPanel using Core Animation
- From: Troy Stephens <email@hidden>
- Date: Thu, 24 Jan 2008 10:14:45 -0800
On Jan 24, 2008, at 7:52 AM, Richard Pollock wrote:
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
Hi Rich,
Sorry for the confusion; you've hit a known bug. [[aWindow animator]
setFrameOrigin:...] should animate, but doesn't.
Use -setFrame:display: instead; that works as intended.
Troy
_______________________________________________
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