Reputation: 101
Please help me. I want to change font size for the text of NSButton.
[myButon setFont:[[NSFont fontWithName:@"Arial" size:20]]];
But it didn't work.
I have another question. How to rotate a NSButton?
Thanks
Upvotes: 0
Views: 1884
Reputation: 27073
Button Font
Your line contains a syntax error, one pair of brackets should be removed.
The following line works correctly:
[theButton setFont:[NSFont fontWithName:@"Arial" size:20]];
Make sure the IBOutlet
is connected properly to the NSButton
.
Rotate Button
You can simply create an .png image with the vertical button title.
Use 13px Lucida Grande to make it look native.
Next add the image to a Bevel Button.
The final result looks pretty good.
Upvotes: 1
Reputation: 10865
To rotate the button you may call
[button setFrameRotation:90];
That will rotate the button 90° anticlockwise.
Upvotes: 2