tags:

views:

6

answers:

0

I want a popupbutton with only a custom image (type pulldown, no title, no arrows) that change the image when the user click on it.

I first tried to do it in IB setting the bezel to square and resizing the popupButton the same size of the image. But the image doesn´t appears completely (there is a "margin" at the left and right sides).

So I have subclass NSPopUpButtonCell and override -drawWithFrame:inView: drawing the image in the cellframe. And works fine, but I can´t detect when the user clicks the popupButton to draw the alt image.

When I needed to subclass the NSButtonCell I used [self mouseDownFlags] and [self state] but for the NSPopUpButtonCell it doesn´t work (state is always ON and mouseDownFlags NO).

Any idea? Thanks in advance.