|
|
Re: MessageConsole Background Color Does Not Change [message #606417 is a reply to message #606384] |
Wed, 04 August 2010 09:00 |
No real name Messages: 4 Registered: July 2010 |
Junior Member |
|
|
Hi, I have found the solution, I don't know if still useful for you, but I will let it here for someone searching for the same problem.
The color isn't changed because the setBackground or setColor raise an "Invalid thread access" exception because trying to access the UI thread and then the color isn't changed. The calls should be done synchronized with the UI thread in the following way:
TextMessageConsole myConsole = findConsole("My Console");
// Set colors of console background, output and error
// but in a synchronized way with the UI-thread
Display.getDefault().syncExec(new Runnable() {
public void run() {
MessageConsoleStream out = myConsole.newMessageStream();
myConsole.setBackground(new Color(null, 0, 0, 0);
out.setColor(new Color(null, 255, 0, 0);
}
And color is changed. Hope it helps.
|
|
|
Powered by
FUDForum. Page generated in 0.02329 seconds