Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » "Rounded" buttons with SWT?
"Rounded" buttons with SWT? [message #467179] Thu, 26 January 2006 00:54 Go to next message
Eclipse UserFriend
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 07:27 Go to previous messageGo to next message
Eclipse UserFriend
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 07:37 Go to previous messageGo to next message
Eclipse UserFriend
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 14:42 Go to previous messageGo to next message
Eclipse UserFriend
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] Thu, 26 January 2006 21:44 Go to previous messageGo to next message
Eclipse UserFriend
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] Thu, 26 January 2006 23:00 Go to previous messageGo to next message
Eclipse UserFriend
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] Thu, 26 January 2006 23:56 Go to previous message
Eclipse UserFriend
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: Fri Jul 04 05:20:31 EDT 2025

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

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

Back to the top