Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » button text color change(basic function help wanted)
icon5.gif  button text color change [message #505343] Tue, 29 December 2009 13:23 Go to next message
B  is currently offline B Friend
Messages: 1
Registered: December 2009
Junior Member
Hi!

This is a very basic question. I want to change the color of the text in a SWT button in the simplest way.
I have seen there might be a eclipse bug on win32-systems where u can't change colors of a button at all. However, changing the background of my radio button to black is no problem. But I want to change to color of the text. Setforeground doesn't work. Is it suppose to, or is there another way one should do it?

Best regards
B
Re: button text color change [message #505727 is a reply to message #505343] Mon, 04 January 2010 11:54 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Control.setForeground() is the right way to do what you want, so if it does
not work for you then it's not natively supported. Most Controls allow you
to change their foregrounds and backgrounds, but there are a few
platform-specific ones that don't.

Grant


"B" <bjorn.hagglund@gmail.com> wrote in message
news:hhdhde$bjr$1@build.eclipse.org...
> Hi!
>
> This is a very basic question. I want to change the color of the text in a
SWT button in the simplest way.
> I have seen there might be a eclipse bug on win32-systems where u can't
change colors of a button at all. However, changing the background of my
radio button to black is no problem. But I want to change to color of the
text. Setforeground doesn't work. Is it suppose to, or is there another way
one should do it?
>
> Best regards
> B
Previous Topic:tree where some items do and some items don't have check boxes?
Next Topic:Button's Background on ExpandBar not transparent
Goto Forum:
  


Current Time: Tue Dec 03 00:28:51 GMT 2024

Powered by FUDForum. Page generated in 0.06740 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top