Animated NSImage inside NSMenuItem

  • Is it possible to have animated GIF inside NSMenuItem?

    At the moment I use [menuItem setImage: animatedImage] to set the
    image of the menu item instance however the image is NOT animated
    (only displays the first frame)

    I create the NSImage instance with this:

    NSString *urlString = @"http://www.someserver.com/animation_loop.gif";
    NSURL *url = [NSURL URLWithString: urlString];
    NSData *imageRawData = [url resourceDataUsingCache: NO];
    NSImage *animatedImage = [[NSImage alloc] initWithData: imageRawData];

    -Vance
  • On Oct 26, 2007, at 12:33 PM, vance wrote:

    > Is it possible to have animated GIF inside NSMenuItem?
    >
    > At the moment I use [menuItem setImage: animatedImage] to set the
    > image of the menu item instance however the image is NOT animated
    > (only displays the first frame)

    No, the NSImage is converted to a static CGImageRef for rendering in
    the menu item.

    -eric
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today