Re: Setting image one pulldown popup button

Christiaan Hofman <[email protected]>
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
On Dec 7, 2009, at 1:59, Shawn Erickson wrote:

> On Sun, Dec 6, 2009 at 4:12 PM, Christiaan Hofman <[email protected]> wrote:
>> On Mon, Dec 7, 2009 at 1:04 AM, Matt Neuburg <[email protected]> wrote:
>> 
>> This is the code I use:
>> 
>> overflowButton = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0, 0, 17,
>> 10) pullsDown:YES];
>> [overflowButton setBordered:NO];
>> [[overflowButton cell] setArrowPosition:NSPopUpNoArrow];
>> [[overflowButton cell] setAltersStateOfSelectedItem:NO];
>> [[overflowButton cell] setBackgroundStyle:NSBackgroundStyleRaised];
>> [overflowButton addItemWithTitle:@""];
>> [[overflowButton itemAtIndex:0] setImage:[NSImage imageNamed:@"Overflow"]];
>> 
>> Though I've used several other variations without any change in behavior.
> 
> How are you putting that button into a view? You sure you are actually
> interacting with pop-up button you think you are?
> 
> -Shawn

Just using addSubview:, and i know it's there because the (correct) menu pops up, even if I don't see anything where the button is.

Christiaan
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.