• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Move NSPanel using Core Animation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Move NSPanel using Core Animation (From: Richard Pollock <email@hidden>)

  • Prev by Date: Changing CALayer's contents too rapidly causes CoreAnimation to implode?
  • Next by Date: Re: NSTimer preventing sleep?
  • Previous by thread: Move NSPanel using Core Animation
  • Next by thread: Scaling CGPDFPageRefs
  • Index(es):
    • Date
    • Thread