Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT button
SWT button [message #465124] Tue, 06 December 2005 13:33 Go to next message
Eclipse UserFriend
Originally posted by: zveber.zelnet.ru

I'm creating swt button and call methods setText() and setImage(), but
don't see both image and text on button. Using Eclipse 3.2M2
Re: SWT button [message #465134 is a reply to message #465124] Tue, 06 December 2005 16:23 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Zveber wrote:
> I'm creating swt button and call methods setText() and setImage(), but
> don't see both image and text on button. Using Eclipse 3.2M2
>

some lines of could would help us really ;-)

Tom
Re: SWT button [message #465136 is a reply to message #465124] Tue, 06 December 2005 16:54 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
On Windows XP you need to have a manifest to see both. Earlier versions of
Windows do not support both text and image - in those cases, the last method
you call is what will be shown.

See:
http://eclipse.org/swt/faq.php#xpthemes

For all other platforms, you should see both.

"Zveber" <zveber@zelnet.ru> wrote in message
news:1ce7e577df270836515296a0532355d1$1@www.eclipse.org...
> I'm creating swt button and call methods setText() and setImage(), but
> don't see both image and text on button. Using Eclipse 3.2M2
>
Re: SWT button [message #465140 is a reply to message #465136] Tue, 06 December 2005 17:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mwilli.iastate.edu

Alternatively, you could use javaw.exe to launch the program, this seems
to work fine on windows xp, without a manifest file.

Veronika Irvine wrote:
> On Windows XP you need to have a manifest to see both. Earlier versions of
> Windows do not support both text and image - in those cases, the last method
> you call is what will be shown.
>
> See:
> http://eclipse.org/swt/faq.php#xpthemes
>
> For all other platforms, you should see both.
>
> "Zveber" <zveber@zelnet.ru> wrote in message
> news:1ce7e577df270836515296a0532355d1$1@www.eclipse.org...
>> I'm creating swt button and call methods setText() and setImage(), but
>> don't see both image and text on button. Using Eclipse 3.2M2
>>
>
>
Re: SWT button [message #465208 is a reply to message #465124] Thu, 08 December 2005 07:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lostintranslation.hotmail.com

Have you set the Bounds for your buttons?
Re: SWT button [message #465309 is a reply to message #465140] Thu, 08 December 2005 21:33 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Mike, what Java VM are you using? It seems that your javaw has been
compiled differently.

"Mike Williams" <mwilli@iastate.edu> wrote in message
news:dn4gev$qq9$1@news.eclipse.org...
> Alternatively, you could use javaw.exe to launch the program, this seems
> to work fine on windows xp, without a manifest file.
>
> Veronika Irvine wrote:
>> On Windows XP you need to have a manifest to see both. Earlier versions
>> of Windows do not support both text and image - in those cases, the last
>> method you call is what will be shown.
>>
>> See:
>> http://eclipse.org/swt/faq.php#xpthemes
>>
>> For all other platforms, you should see both.
>>
>> "Zveber" <zveber@zelnet.ru> wrote in message
>> news:1ce7e577df270836515296a0532355d1$1@www.eclipse.org...
>>> I'm creating swt button and call methods setText() and setImage(), but
>>> don't see both image and text on button. Using Eclipse 3.2M2
>>>
>>
Re: SWT button [message #465364 is a reply to message #465208] Sat, 10 December 2005 13:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zveber.zelnet.ru

Sorry, I have make mistake... I'm using 3.2M3 =).
&#1055;&#1086;-&#1088;&#1091;&#1089;& ;#1089;&#1082;&#1080;...
&#1063;&#1077;&#1088;&#1090;&#1086;& #1074;&#1072;
&#1082;&#1085;&#1086;&#1087;&#1082;& #1072;
&#1085;&#1080;&#1092;&#1080;&#1075;& #1072; &#1085;&#1077;
&#1088;&#1080;&#1089;&#1091;&#1077;& #1090;&#1089;&#1103; &#1089;
&#1082;&#1072;&#1088;&#1090;&#1080;& #1085;&#1082;&#1086;&#1081;)).
Re: SWT button [message #465605 is a reply to message #465124] Thu, 15 December 2005 19:00 Go to previous messageGo to next message
Page Mising name is currently offline Page Mising nameFriend
Messages: 31
Registered: July 2009
Member
Hi,

I am having the same problem. The button only should either the image or
the text, whichever is set later.

I am using Win2000, JDK1.5, really appreciate your help to get this
resolved.

Here is the code:

Button gettingStarted = new Button(parent, SWT.PUSH | SWT.LEFT);
gettingStarted.setText(r.getString("gettingStarted"));
//TODO: backgroup color cannot be set for PUSH style button.
//gettingStarted.setBackground(new Color(null, 0, 0, 255));
//TODO: cannot set image and text for button at same time.
gettingStarted.setImage(new Image(null,
"D:\\temp\\homefolder_16.png"));


Thanks.
Page
Re: SWT button [message #465607 is a reply to message #465605] Thu, 15 December 2005 19:07 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
The native button on Windows 2000 does not support both text and an image at
the same time. The expected behaviour is that whatever API is called last
(setImage() or setText()) wins.

You need Windows XP with a manifest to see both the image and text at the
same time on Windows.
http://eclipse.org/swt/faq.php#xpthemes

"Page" <pagew2000@yahoo.com> wrote in message
news:f012436b7b9e17db3dadc3a35751489b$1@www.eclipse.org...
> Hi,
>
> I am having the same problem. The button only should either the image or
> the text, whichever is set later.
>
> I am using Win2000, JDK1.5, really appreciate your help to get this
> resolved.
>
> Here is the code:
>
> Button gettingStarted = new Button(parent, SWT.PUSH | SWT.LEFT);
> gettingStarted.setText(r.getString("gettingStarted"));
> //TODO: backgroup color cannot be set for PUSH style button.
> //gettingStarted.setBackground(new Color(null, 0, 0, 255));
> //TODO: cannot set image and text for button at same time.
> gettingStarted.setImage(new Image(null,
> "D:\\temp\\homefolder_16.png"));
>
>
> Thanks.
> Page
>
Previous Topic:Text Widget Width
Next Topic:Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Display
Goto Forum:
  


Current Time: Thu Mar 28 11:06:54 GMT 2024

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

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

Back to the top