Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Border around Image Button
Border around Image Button [message #489034] Thu, 01 October 2009 09:43 Go to next message
Alwin  is currently offline Alwin Friend
Messages: 5
Registered: October 2009
Junior Member
Hello,

I have a SWT Push Button which shows an image. Is there a way to remove the border around the image?

Thanks

Alwin
Re: Border around Image Button [message #489121 is a reply to message #489034] Thu, 01 October 2009 14:44 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
I assume you mean the border around the Button (?). Your choices are:

- create the Button with style SWT.FLAT | SWT.PUSH, which on some platforms
will lessen the border (but will not remove it completely), or
- create a SWT.FLAT ToolBar with a ToolItem as shown in
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet36. java
(remove the ToolBar's SWT.BORDER style and the ToolItem's SWT.DROP_DOWN
style)

Grant


"Alwin" <alwin.schmitz@it-motive.de> wrote in message
news:ha1tk3$eh7$1@build.eclipse.org...
> Hello,
>
> I have a SWT Push Button which shows an image. Is there a way to remove
the border around the image?
>
> Thanks
>
> Alwin
Re: Border around Image Button [message #489132 is a reply to message #489121] Thu, 01 October 2009 15:15 Go to previous messageGo to next message
Alwin  is currently offline Alwin Friend
Messages: 5
Registered: October 2009
Junior Member
Hi Grant,

thanks!
The toolbar worked for me

Alwin
Re: Border around Image Button [message #922952 is a reply to message #489132] Tue, 25 September 2012 13:37 Go to previous messageGo to next message
Parag AgarkarFriend
Messages: 2
Registered: September 2012
Location: India
Junior Member
Is there any other way to achieve this ?

I have similar requirement. I tried toolbar approach but that does not help me because ToolItem is not grabbing focus when I press keyboard tab button.

When we create a button with style as SWT.ARROW, margins are not there. Can similar behavior be achieved ?


- Parag
Re: Border around Image Button [message #1108923 is a reply to message #489121] Sat, 14 September 2013 16:16 Go to previous message
Ibai U. is currently offline Ibai U.Friend
Messages: 1
Registered: August 2013
Junior Member
Thanks Grant!

The toolbar option worked for me in a RAP application using SWT.

By the way, eclipse has moved to git so the new link of the Toolbar Snippet is:

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet36.java
Previous Topic:Linux: Clicking on Combo looses focus very soon
Next Topic:How can I associate custom widgets with TreeItems in SWT?
Goto Forum:
  


Current Time: Wed Apr 24 18:11:00 GMT 2024

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

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

Back to the top