Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to change List font?
How to change List font? [message #117883] Thu, 08 January 2009 10:50 Go to next message
Michael Haendel is currently offline Michael HaendelFriend
Messages: 5
Registered: July 2009
Junior Member
I tried to change the font of a List with the setFont() method, but the
font always stays the same. Do you have any ideas how to set a specific
font for the List elements?

Thanks in advance,
Michael.
Re: How to change List font? [message #117899 is a reply to message #117883] Thu, 08 January 2009 11:34 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Michael,

setting the font of List works as expected in the Controls Demo with
both setFont() and via theming. Can you provide a snippet for
reproducing the problem?

Best,
Ivan

Michael Haendel wrote:
> I tried to change the font of a List with the setFont() method, but
> the font always stays the same. Do you have any ideas how to set a
> specific font for the List elements?
>
> Thanks in advance,
> Michael.
>
Re: How to change List font? [message #117911 is a reply to message #117899] Thu, 08 January 2009 13:09 Go to previous messageGo to next message
Michael Haendel is currently offline Michael HaendelFriend
Messages: 5
Registered: July 2009
Junior Member
Thanks for the fast replay, Ivan.

Here's the snippet:

public class WidgetTest implements IEntryPoint {
public int createUI() {
Display display = new Display();
Shell shell = new Shell(display, SWT.NO_TRIM);
shell.setLayout(new FillLayout());
List li = new List(shell, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
for (int i = 0; i < 6; i++){
li.add("Element " + i);
}
li.setFont(Graphics.getFont("Helvetica", 20, SWT.BOLD));
shell.open();

while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return 0;
}
}

Setting the font this way works for all widgets (I tested Combo and Label)
, but not for the List. I'm using RAP 1.2M3 and deploy on Tomcat.

Regards,
Michael.

Ivan Furnadjiev wrote:

> Hi Michael,

> setting the font of List works as expected in the Controls Demo with
> both setFont() and via theming. Can you provide a snippet for
> reproducing the problem?

> Best,
> Ivan

> Michael Haendel wrote:
>> I tried to change the font of a List with the setFont() method, but
>> the font always stays the same. Do you have any ideas how to set a
>> specific font for the List elements?
>>
>> Thanks in advance,
>> Michael.
>>
Re: How to change List font? [message #117923 is a reply to message #117911] Thu, 08 January 2009 15:27 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Michael,

thank you for pointing this. It was a bug and I fixed it in CVS HEAD.

Best,
Ivan

Michael Haendel wrote:
> Thanks for the fast replay, Ivan.
>
> Here's the snippet:
>
> public class WidgetTest implements IEntryPoint {
> public int createUI() {
> Display display = new Display();
> Shell shell = new Shell(display, SWT.NO_TRIM);
> shell.setLayout(new FillLayout());
> List li = new List(shell, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
> for (int i = 0; i < 6; i++){
> li.add("Element " + i);
> }
> li.setFont(Graphics.getFont("Helvetica", 20, SWT.BOLD));
> shell.open();
>
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch()) {
> display.sleep();
> }
> }
> return 0;
> }
> }
>
> Setting the font this way works for all widgets (I tested Combo and
> Label) , but not for the List. I'm using RAP 1.2M3 and deploy on Tomcat.
>
> Regards,
> Michael.
>
> Ivan Furnadjiev wrote:
>
>> Hi Michael,
>
>> setting the font of List works as expected in the Controls Demo with
>> both setFont() and via theming. Can you provide a snippet for
>> reproducing the problem?
>
>> Best,
>> Ivan
>
>> Michael Haendel wrote:
>>> I tried to change the font of a List with the setFont() method, but
>>> the font always stays the same. Do you have any ideas how to set a
>>> specific font for the List elements?
>>>
>>> Thanks in advance,
>>> Michael.
>>>
>
>
Previous Topic:Problem with popup menu of table
Next Topic:insight required on changing values in TableViewer with asyncExec
Goto Forum:
  


Current Time: Fri Apr 19 06:54:38 GMT 2024

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

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

Back to the top