NSMenuItem setImage:
NSMenuItem setImage:
- Subject: NSMenuItem setImage:
- From: David Litwin <email@hidden>
- Date: Wed, 12 Jun 2002 17:39:00 -0700
I'd like to have a small icon show to the left of my menu item, and
NSMenuItem setImage: seems to be just the thing. But it doesn't seem to
be working for me. The menu items show up fine, no errors are reported,
but no icons show. Here's a snippet of the code:
NSMenu* myMenu;
NSMenuItem* menuItem;
NSImage* itemImage;
menuItem = [myMenu addItemWithTitle:@"some string"
action:nil
keyEquivalent:@""];
// Now use this .tiff file as an NSImage for our item
itemImage = [[NSImage alloc] initWithContentsOfFile:@"Some .tiff
file"];
[menuItem setImage:itemImage];
I've checked that itemImage isn't nil, and in fact has the right
dimensions of the .tiff loaded, so it seems to have been loaded
correctly but just doesn't want to display.
Has anyone used setImage with NSMenuItem?
Thanks,
David Litwin
Senior Software Engineer
Connectix
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.