I'm working on project which based on macruby and hotcocoa framework. I don't know objective c. In my project I would like to change color of button (NSButton). Do you know how to achieve this using hotcocoa mappers or macruby?
Asked
Active
Viewed 71 times
1 Answers
0
Setting the background color of NSButton is not directly supported. A robust way to create a customized button is to subclass NSButton and override drawRect:. Another way is to customize the button using CALayers.
layer = CALayer.layer
layer.backgroundColor = NSColor.orangeColor.CGColor
button.setLayer layer
button.setWantsLayer true

jtomschroeder
- 1,034
- 7
- 11