Cocoa Snippet: Detonate your Cursor

April 18, 2007 at 12:33 pm

- (IBAction)poofCursor:(id)sender
NSShowAnimationEffect(NSAnimationEffectPoof, [NSEvent mouseLocation], NSZeroSize, NULL, NULL, NULL);
[NSCursor hide];

In case you can’t figure it out, this code shows the *poof* animation one gets when dragging items off the Dock at the current mouse location, then hides the mouse. The overall effect resembles the mouse cursor exploding.

Entry filed under: cocoa, silly, snippets, this-is-stupid.

Five Things that Suck About Objective-C and Cocoa Whither High School Computer Science?

About Me

I'm Patrick Thomson. This was a blog about computer programming and computer science that I wrote in high school and college. I have since disavowed many of the views expressed on this site, but I'm keeping it around out of fondness.

If you like this, you might want to check out my Twitter or Tumblr, both of which are occasionally about code.

Blog Stats

  • 697,395 hits

%d bloggers like this: