DONE: coloring button's Title

Coding Questions, IDE related or anything else

DONE: coloring button's Title

Postby udo.killermann » Thu Oct 07, 2010 3:53 pm

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
--------------
MacBook (2GHz, 4 GByte) - Lion (10.7.3)
started Objective Basic coding in April 2010 - still enjoy it ;-)
udo.killermann
 
Posts: 247
Joined: Thu Apr 08, 2010 6:46 am
Location: Hannover, Germany

Re: coloring button's Title

Postby berndnoetscher » Thu Nov 04, 2010 2:29 pm

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?
berndnoetscher
Site Admin
 
Posts: 280
Joined: Fri Feb 20, 2009 11:58 am

Re: coloring button's Title

Postby udo.killermann » Fri Nov 05, 2010 7:34 am

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
--------------
MacBook (2GHz, 4 GByte) - Lion (10.7.3)
started Objective Basic coding in April 2010 - still enjoy it ;-)
udo.killermann
 
Posts: 247
Joined: Thu Apr 08, 2010 6:46 am
Location: Hannover, Germany

Re: coloring button's Title

Postby berndnoetscher » Fri Nov 05, 2010 10:13 am

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...
berndnoetscher
Site Admin
 
Posts: 280
Joined: Fri Feb 20, 2009 11:58 am

Re: DONE: coloring button's Title

Postby udo.killermann » Fri Dec 10, 2010 8:47 am

Bernd,

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

Regards
Udo
--------------
MacBook (2GHz, 4 GByte) - Lion (10.7.3)
started Objective Basic coding in April 2010 - still enjoy it ;-)
udo.killermann
 
Posts: 247
Joined: Thu Apr 08, 2010 6:46 am
Location: Hannover, Germany

Re: DONE: coloring button's Title

Postby berndnoetscher » Fri Dec 10, 2010 9:57 am

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
berndnoetscher
Site Admin
 
Posts: 280
Joined: Fri Feb 20, 2009 11:58 am


Return to Objective-Basic (Xcode 3)

Who is online

Users browsing this forum: No registered users and 0 guests

cron