Re: Setting image one pulldown popup button

Matt Neuburg <[email protected]>
Newsgroups gmane.comp.macosx.devel
Message-ID <C7415133.4F8C7%[email protected]>
On or about 12/4/09 12:00 PM, thus spake "[email protected]"
<[email protected]>:

> Date: Fri, 4 Dec 2009 12:36:10 +0100
> From: Christiaan Hofman <[email protected]>
> Subject: Setting image one pulldown popup button
> 
> After trying long and many times, I am unable to set the image on a pulldown
> NSPopUpButton in code (it works in IB).
> 
> I am aware that -setImage: does nothing. According to the docs, the image is
> taken from the first menu item, so I set the image on the item at index 0. I
> also played with other settings (in particular image position NSImageOnly and
> unbordered) but that has no effect. Also the order in which I set the image,
> add the menu item, set pullsdown, etc does not seem to make any effect.
> Neither does calling sycnhronizeTitleAndSelectedItem (though that should not
> be relevant anyway). I never see the image.
> 
> So does anyone know what I need to do to get the image in a popup?
> 

Apple's MenuMadness example does not help here? Works okay on my machine...
Perhaps I'm not understanding what the problem is. m.

-- 
matt neuburg, phd = [email protected], http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.