Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » "Rounded" buttons with SWT?
"Rounded" buttons with SWT? [message #467179] Thu, 26 January 2006 05:54 Go to next message
Edward Kuns is currently offline Edward KunsFriend
Messages: 14
Registered: July 2009
Junior Member
Is there a way to make or simulate buttons with rounded contours with
SWT? Something other than buttons with 90 degree corners? I'm looking
for something like that drawn by gc.drawRoundedRectangle().

Thanks

Eddie
Re: "Rounded" buttons with SWT? [message #467204 is a reply to message #467179] Thu, 26 January 2006 12:27 Go to previous messageGo to next message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 489
Registered: July 2009
Senior Member
Eddie,

SWT uses the native system widgets to draw buttons. So for example, all
buttons are rounded on Mac OS X:
http://www.eclipse.org/vep/WebContent/docs/newAndNoteworthy/ 1.2-M1/swt-osx1.jpg

If you want your buttons to follow the Windows XP widget themes see this
FAQ item: http://www.eclipse.org/swt/faq.php#xpthemes

Otherwise, you can't really do much to affect the way the native widgets
are drawn. If you want different behavior, you'll have to create an
emulated button, rather than relying on SWT.

Hope this helps,
- Jeff
Re: "Rounded" buttons with SWT? [message #467206 is a reply to message #467179] Thu, 26 January 2006 12:37 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Maybe some custom widget project provides a button for you:
- http://www.eclipse.org/proposals/nebula/
- http://sourceforge.net/projects/c-swt/

Tom

Edward Kuns wrote:
> Is there a way to make or simulate buttons with rounded contours with
> SWT? Something other than buttons with 90 degree corners? I'm looking
> for something like that drawn by gc.drawRoundedRectangle().
>
> Thanks
>
> Eddie
Re: "Rounded" buttons with SWT? [message #467234 is a reply to message #467204] Thu, 26 January 2006 19:42 Go to previous messageGo to next message
Edward Kuns is currently offline Edward KunsFriend
Messages: 14
Registered: July 2009
Junior Member
Jeff Myers wrote:
> SWT uses the native system widgets to draw buttons.

Yes. I guess I was partially wondering if there were any hints one
could provide or some other way to get SWT to round the buttons.

> If you want your buttons to follow the Windows XP widget themes see this
> FAQ item: http://www.eclipse.org/swt/faq.php#xpthemes

Thanks. I was aware of that, but this is for a Java Webstart
application where I don't believe we can do what is called for in that
FAQ item. Unless there is a way with SWT to have it follow the XP
widget themes even for a Webstart application?

Thanks for the help.

Eddie
Re: "Rounded" buttons with SWT? [message #467241 is a reply to message #467234] Fri, 27 January 2006 02:44 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
For you to have Windows XP themes over a Webstart, you will have to place the javaw.exe.manifest file in the jre/bin directory and rename it to javaws.exe.manifest. Then the application must be restarted. After the manifest has been placed, the XP theme will be followed. [Note:] Most of the time when the manifest hack doesn't work, it's because the manifest is placed in the wrong directory (i.e. not the one being used by the jre). This probably wouldn't be a problem if you use System.getProperties("jre.home") but I thought I'd mention it.
Re: "Rounded" buttons with SWT? [message #467249 is a reply to message #467241] Fri, 27 January 2006 04:00 Go to previous messageGo to next message
Edward Kuns is currently offline Edward KunsFriend
Messages: 14
Registered: July 2009
Junior Member
Daniel Spiewak wrote:
> For you to have Windows XP themes over a Webstart, you will have to place the javaw.exe.manifest file in the jre/bin directory and rename it to javaws.exe.manifest. Then the application must be restarted. After the manifest has been placed, the XP theme will be followed. [Note:] Most of the time when the manifest hack doesn't work, it's because the manifest is placed in the wrong directory (i.e. not the one being used by the jre). This probably wouldn't be a problem if you use System.getProperties("jre.home") but I thought I'd mention it.

Oh, that's actually a lot easier than I was thinking. Thank you VERY
much! I'll try that out.

Eddie
Re: "Rounded" buttons with SWT? [message #467253 is a reply to message #467241] Fri, 27 January 2006 04:56 Go to previous message
Edward Kuns is currently offline Edward KunsFriend
Messages: 14
Registered: July 2009
Junior Member
Daniel Spiewak wrote:
> For you to have Windows XP themes over a Webstart, you will have to place the javaw.exe.manifest file in the jre/bin directory and rename it to javaws.exe.manifest.

I tried this and it is just that easy. Totally awesome! Thanks again.
I haven't coded yet anything to copy the manifest into place, but with a
signed webstart application, one should have the privileges needed. And
maybe there's a trick one can play to get the manifest into place the
first time and then have the application re-run itself (or something) so
the application looks right the very first time it is run.

Someone ought to update the FAQ to specifically mention that this works
with Java WebStart.

FYI: I seemed to need to give a manifest to javaw.exe in the same
directory. It's possible that I didn't need to apply a manifest to
javaws.exe after all, since webstart seems to always run the application
itself with javaw.

Eddie
Previous Topic:Should setBackgroundImage() work on a button on win32?
Next Topic:itemMenu bis
Goto Forum:
  


Current Time: Thu Apr 18 20:59:07 GMT 2024

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

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

Back to the top