is there any way to set text color of a (NS)Button in IB?
as the title reads.. is there? i'm using xcode 4.6
xcode-OTHER, OS X Mountain Lion (10.8.2)
as the title reads.. is there? i'm using xcode 4.6
xcode-OTHER, OS X Mountain Lion (10.8.2)
If you are asking about the actual text color then yes it is possible but not so simple.
If you look at the class definition for NSButton youwill see two methods
– setAttributedAlternateTitle:– setAttributedTitle:These will allow you to specify an attributed string as the button label and in the attributed string you can set the string attributes such as color.
If you are just looking to change the background color or somehtingalong those lines that can be done right in NSButton.
Hi Frank and thank you for your response!
I know how to do it programmatically but i was wondering if it is possible in Interface Builder..? Seeing as it is just an attributedString i would imagine it should be.. I've tried setting the color of it in the font editor of the button, the cell and then, thinking i had finally found it, of the actual string (by first selecting the cell, then double-clicking the title, right-clicking the directly editable text and selecting Font > Show colors) but without results. Right now i've subclassed NSButton and implemented some setTitleColorWith... functions but it feels a bit silly to have to set up the default UI-look programmatically when you have IB!
IB is good but it can't do everything. This does seem like something that should be doable in IB I don't believe it is.
Might be worth feedback to Apple.
Allrighty, i guess a feat-request it is then!
is there any way to set text color of a (NS)Button in IB?