SWT-Designer 1.2.1 Pro: Not showing label colors

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

SWT-Designer 1.2.1 Pro: Not showing label colors

Postby cebarne2 » Thu Nov 13, 2003 8:29 am

In the designer editor, labels do not appear with the specified colors. This is closely related to the problem that the designer hangs when trying to change a color property.

Here is my source code that specifies a color... it works when running the application, but the label (which turns out to be a red box), is not red in the designer.

Thanks,
Chad

public class ClockMain {

public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell();
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 6;
shell.setLayout(gridLayout);
shell.setText("SWT Application");
{
final Label lbl00 = new Label(shell, SWT.NONE);
lbl00.setText("button");
lbl00.setBackground(new Color(shell.getDisplay(), new RGB(255,0,0)));
lbl00.setForeground(new Color(shell.getDisplay(), new RGB(255,0,0)));
}
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
}
cebarne2
 
Posts: 67
Joined: Tue Sep 23, 2003 10:11 am
Location: Cedar Rapids, IA

Postby admin » Thu Nov 13, 2003 9:21 pm

We look for our ResourceManager call when check that there are settings for foreground and background colors. Main reason is that we use ResourceManager for all resources: images, colors and fonts.

Code: Select all
      {
         final Text text = new Text(shell, SWT.BORDER);
         text.setForeground(ResourceManager.getColor(SWT.COLOR_DARK_GREEN));
         text.setBackground(ResourceManager.getColor(198, 191, 242));
         text.setFont(ResourceManager.getFont("Comic Sans MS", 20, SWT.BOLD));
         final GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
         gridData.horizontalSpan = 3;
         text.setLayoutData(gridData);
         text.setText("horizontalSpan = 3 Text");
      }
admin
Moderator
 
Posts: 166
Joined: Thu Jul 24, 2003 12:25 am

Re: SWT-Designer 1.2.1 Pro: Not showing label colors

Postby Eric Clayberg » Sat Nov 15, 2003 6:07 pm

cebarne2 wrote:In the designer editor, labels do not appear with the specified colors. This is closely related to the problem that the designer hangs when trying to change a color property.

this should now be fixed in the 1.2.2 Beta.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest