• 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: NSImage in a NSMenuItem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage in a NSMenuItem?


  • Subject: Re: NSImage in a NSMenuItem?
  • From: "John C. Randolph" <email@hidden>
  • Date: Wed, 29 Sep 2004 15:09:52 -0700


On Sep 29, 2004, at 2:59 PM, wURLdBook Research wrote:

Hi, 

I was trying to set a NSImage in a NSMenuItem in the DockMenu. I can't
seem get it to work even though I am doing all the normal stuffl like
[menutItem setImage:anImage].

Is there a trick?

On Sep 29, 2004, at 2:59 PM, wURLdBook Research wrote:

Hi, 

I was trying to set a NSImage in a NSMenuItem in the DockMenu. I can't
seem get it to work even though I am doing all the normal stuffl like
[menutItem setImage:anImage].

Is there a trick?

The trick is to use an NSAttributedString with the image imbedded, and set that string as the menu item's title.

-jcr



John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSImage in a NSMenuItem?
      • From: Olav Anderson <email@hidden>
References: 
 >NSImage in a NSMenuItem? (From: wURLdBook Research <email@hidden>)

  • Prev by Date: NSImage in a NSMenuItem?
  • Next by Date: Re: makeFirstResponder NOT working
  • Previous by thread: NSImage in a NSMenuItem?
  • Next by thread: Re: NSImage in a NSMenuItem?
  • Index(es):
    • Date
    • Thread