Mike Nathas
Mike Nathas

Reputation: 1393

Prevent title change of NSPopUpButton at selection

I have a NSPopUpButton without title. I set a NSImage for this popup button. When I bind the Content value to an array with strings (to create a demo) the title of the popup button changes to the value of the array.

Is there a way to keep the image and prevent the title to change?

Thanks!

Upvotes: 2

Views: 629

Answers (1)

Willeke
Willeke

Reputation: 15589

This is how NSPopUpButton works, it displays the selection. If you want to use it to trigger an action, set the type to "Pull Down". The first item in the array is the title.

The NSPopUpButtonCell class defines the visual appearance of pop-up buttons that display pop-up or pull-down menus. Pop-up menus present the user with a set of choices, much the way radio buttons do, but using much less space. Pull-down menus also provide a set of choices but present the information in a slightly different way, usually to provide a set of commands from which the user can choose.

Upvotes: 2

Related Questions