The toolbar in Pages (Numbers, Keynote) has a NSPopUpButton with a fixed image (irrespective of the menu that is selected). Using view debugging it turns out that this is a standard NSPopUpButton with a fixed image.
According to the NSPopUpButton docs regarding setImage:
,
This method has no effect. The image displayed in a pop up button cell is taken from the selected menu item (in the case of a pop up menu) or from the first menu item (in the case of a pull-down menu).
This means that this standard NSPopUpButton has non-standard behaviour.
How could this be implemented? Because setImage:
has no effect, subclass the NSPopUpButtonCell and overriding -drawImage:withFrame:inView:
has no effect (because it is never called).