[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Multiple Fonts problem

Hi there,

I have come across a rather strange problem with fonts in my code.

A Label is created in the createPartControl() method of a View and I have written a refresh() method to be executed when the underlying algorithm has finished a step thus altering the text on the Label.

This works just fine but when I try to change the Font of the Label between it's initial creation in createPartControl() and refresh() the whole method just stops at the Label.setFont() method.

Any ideas on what I'm doing wrong?

Thx,
Volker

code snippets:


public void createPartControl(Composite parent) { FillLayout fillLayout = new FillLayout(); fillLayout.type = SWT.VERTICAL; parent.setLayout(fillLayout);

infoLabel = new Label(parent, SWT.CENTER);
infoLabel.setFont(new Font(parent.getDisplay(), "Arial", 18, SWT.BOLD));
infoLabel.setText("Not ready");
}


public void refreshScores()
{
infoLabel.setFont(new Font(mainCanvas.getDisplay(), "Arial", 12, SWT.BOLD)); //in this line it just stalls
infoLabel.setText("another message");
}