Page 1 of 1

DONE: coloring button's Title

PostPosted: Thu Oct 07, 2010 3:53 pm
by udo.killermann
Hi Board,

Does anyone know how to color the text of a button? I have tried various ways using InterfaceBuilder but couldn't get where I wanted. There seems to be no easy way to do this by code - or did I overlook something?

Kind regards
Udo

Re: coloring button's Title

PostPosted: Thu Nov 04, 2010 2:29 pm
by berndnoetscher
udo.killermann wrote:Hi Board,

Does anyone know how to color the text of a button? I have tried various ways using InterfaceBuilder but couldn't get where I wanted. There seems to be no easy way to do this by code - or did I overlook something?

Kind regards
Udo


Hi Udo,

it can be done using NSAttributedString

See http://www.pastebuffer.com/2007/10/04/s ... -nsbutton/

I could implement setTextColor in the runtime of objb. What do you think?

Re: coloring button's Title

PostPosted: Fri Nov 05, 2010 7:34 am
by udo.killermann
Bernd,

I think it would be nice to see it in the runtime. As you can see from my latest example and the bug report I posted, I finally mastered NSAttributedString or at least its mutable cousin.

Have a nice day
Udo

Re: coloring button's Title

PostPosted: Fri Nov 05, 2010 10:13 am
by berndnoetscher
udo.killermann wrote:Bernd,

I think it would be nice to see it in the runtime. As you can see from my latest example and the bug report I posted, I finally mastered NSAttributedString or at least its mutable cousin.

Have a nice day
Udo


Just added it to the runtime. Will come with the next update the next days...

Re: DONE: coloring button's Title

PostPosted: Fri Dec 10, 2010 8:47 am
by udo.killermann
Bernd,

where did you place this addition? I don't find NSAttributedString in the completion hints provided by the IDE.

Regards
Udo

Re: DONE: coloring button's Title

PostPosted: Fri Dec 10, 2010 9:57 am
by berndnoetscher
udo.killermann wrote:Bernd,

where did you place this addition? I don't find NSAttributedString in the completion hints provided by the IDE.

Regards
Udo


Hi Udo

Mhmm.. looks like the docu has not been updated.

The following is working

NSButton:
new property TextColor As NSColor