cocoa - how to set background color of NSButton OSX -
i want set background color of nsbutton.there nothing in attribute inspector wondering if there way programmatically?
system controls need follow apple look&feel, cannot change background colour. if want accomplish this, you'll need subclass nsbutton , overwrite drawrect: method. downside you'll need handle text drawing, , possibly different rendering based on button state.
edit. actually, you'll need subclass nsbuttoncell class drawing stuff, more info can found here: https://developer.apple.com/library/prerelease/mac/documentation/cocoa/reference/applicationkit/classes/nsbuttoncell_class/index.html#//apple_ref/doc/uid/20000093-sw15
Comments
Post a Comment