[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform.swt] Re: Changing the look of a LinkLabel
|
Wow, color me embarrased...your right, I inherited this code, and I am new
to swt, so I just assumed...thanks for the help, I have my problem fixed
now.
"Grant Gayed" <grant_gayed@xxxxxxxxxx> wrote in message
news:ekk8ju$fo1$1@xxxxxxxxxxxxxxxxxxxx
> Hi Arnold,
>
> I'm not sure where LinkLabel comes from, but it's not swt. I've verified
> on
> win32 that the Link widget allows you to change the foreground and font,
> but
> it's possible that LinkLabel isn't using a Link. You should ask this on a
> newsgroup where LinkLabel would live.
>
> Grant
>
>
> "Arnold Cota" <arnold.cota@xxxxxxx> wrote in message
> news:eki7k3$tsk$1@xxxxxxxxxxxxxxxxxxxx
>> Hi,
>>
>> I have some LinkLabel's I am displaying in a Composite. I am trying to
>> change the look of the label via the following code. Only the background
>> color changes, the foreground and font style are ignored. Is this the
>> expected behavior?
>>
>> LinkLabel l1 = new LinkLabel(selectionComposite, SWT.NONE);
>>
>> // Make the text foreground red
>>
>> l1.setForeground(this.getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
>>
>> // Make the text background gray
>>
>> l1.setBackground(this.getDisplay().getSystemColor(SWT.COLOR_GRAY));
>>
>> // Make the text font bold
>>
>> FontData fontData = l1.getFont().getFontData()[0];
>>
>> fontData.setStyle(SWT.BOLD | fontData.getStyle());
>>
>> Font font = new Font(this.getDisplay(), fontData);
>>
>> l1.setFont(font);
>>
>>
>
>