views:

178

answers:

1

I could not find a way in the documentation to tell an NSButton to resize its image to fill up the whole button. Is there a way to do this programatically?

+2  A: 

The closest you'll get is -setImageScaling: ... look up the constants to see how the image will be scaled within the button cell, given its bordered state and bezel type.

If you're looking to replace the standard button entirely with your image (ie, the button cell doesn't draw itself at all - your image serves as the entire visual representation), turn off the border (-setBordered:).

All of these options can be configured in IB as well. A tip: in IB, hover the mouse over any setting in the inspector panel - most if not all give you a hint that shows what method controls the behavior affected by the setting's control.

Joshua Nozzi