Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Can Button only have text XOR image?
Can Button only have text XOR image? [message #453093] Wed, 30 March 2005 14:54 Go to next message
Devin Steffler is currently offline Devin StefflerFriend
Messages: 7
Registered: July 2009
Junior Member
Is there a problem with Button's having both an image and text at the same
time? The examples I've looked at all have Buttons with an image, and a
Label created later to resemble the text of the Button.

I'm using Windows XP Pro and Eclipse 3.1M5 (Build id: I20050219-1500).

Only the text gets displayed with the following code:
typeButton = new Button(upperRow, SWT.CHECK);
typeButton.setFont(upperRow.getFont());

typeButton.setImage(IndexerViewPluginImages.get(IndexerViewP luginImages.IMG_
CLASS));
typeButton.setText("type");

Only the image gets displayed with the following code:
typeButton = new Button(upperRow, SWT.CHECK);
typeButton.setFont(upperRow.getFont());

typeButton.setText("type");

typeButton.setImage(IndexerViewPluginImages.get(IndexerViewP luginImages.IMG_
CLASS));

Thanks,
Devin
Re: Can Button only have text XOR image? [message #453097 is a reply to message #453093] Wed, 30 March 2005 15:14 Go to previous messageGo to next message
Randy Hudson is currently offline Randy HudsonFriend
Messages: 123
Registered: July 2009
Senior Member
It is not supported on all platforms. So SWT ensures same behavior
everywhere.

> Is there a problem with Button's having both an image and text at the same
> time?
Re: Can Button only have text XOR image? [message #453098 is a reply to message #453093] Wed, 30 March 2005 15:47 Go to previous message
Alex Shneyderman is currently offline Alex ShneydermanFriend
Messages: 71
Registered: July 2009
Member
check out SWTWorkbench's swutils plugin. It has CButton, that is capable of
doing both.

"Devin Steffler" <devin_steffler@ca.ibm.com> wrote in message
news:d2eeko$8g2$1@news.eclipse.org...
> Is there a problem with Button's having both an image and text at the same
> time? The examples I've looked at all have Buttons with an image, and a
> Label created later to resemble the text of the Button.
>
> I'm using Windows XP Pro and Eclipse 3.1M5 (Build id: I20050219-1500).
>
> Only the text gets displayed with the following code:
> typeButton = new Button(upperRow, SWT.CHECK);
> typeButton.setFont(upperRow.getFont());
>
> typeButton.setImage(IndexerViewPluginImages.get(IndexerViewP luginImages.IMG_
> CLASS));
> typeButton.setText("type");
>
> Only the image gets displayed with the following code:
> typeButton = new Button(upperRow, SWT.CHECK);
> typeButton.setFont(upperRow.getFont());
>
> typeButton.setText("type");
>
> typeButton.setImage(IndexerViewPluginImages.get(IndexerViewP luginImages.IMG_
> CLASS));
>
> Thanks,
> Devin
>
>
Previous Topic:eclipse 3.1M5 OSGi ?
Next Topic:URL for the API
Goto Forum:
  


Current Time: Wed Aug 21 18:02:04 GMT 2019

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

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

Back to the top