Re: NSMenuItem setImage:
Re: NSMenuItem setImage:
- Subject: Re: NSMenuItem setImage:
- From: David Litwin <email@hidden>
- Date: Wed, 7 Aug 2002 10:39:06 -0700
Although resolved many weeks ago, I though I'd post a response to his
just for those who might search the archives for an answer to this later.
The icons weren't showing up because my menu was part of a Dockling, and
the menus of Docklings don't support icons.
Thanks to Matt Neuburg for his assitance on this,
David Litwin
Senior Software Engineer
Connectix
On Wednesday, June 12, 2002, at 05:39 PM, David Litwin wrote:
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.