I am developing a RCP application where I want to add a button which look like apple os button. I want this look in windows7. Is this possible ?
Asked
Active
Viewed 99 times
0
-
3Don't do that. Apps that pretend that Windows is a Mac are extremely annoying. – SLaks Feb 01 '13 at 04:22
-
1Platform UI guidelines exist for a reason; your app should be consistent with the rest of the platform. http://msdn.microsoft.com/en-us/library/windows/desktop/aa511440.aspx – SLaks Feb 01 '13 at 04:23
-
My company wants me to do that..Is there any way to do that – Feb 01 '13 at 04:25
-
1SWT uses the native widgets. You won't be able to use iOS buttons on a win32 system with SWT out of the box. You will have to do something more sophisticated. Take a look at [this question](http://stackoverflow.com/questions/14496663/how-to-add-an-on-off-sliders-in-swt) maybe it's helpful for you. – jens-na Feb 01 '13 at 07:59
-
Have a look at this: [Writing your own widget](http://www.eclipse.org/articles/Article-Writing%20Your%20Own%20Widget/Writing%20Your%20Own%20Widget.htm). – Baz Feb 01 '13 at 20:09
-
you could draw your own button on Canvas and handle all button related properties and actions. No other easy way! – sambi reddy Feb 05 '13 at 19:27
-
Why did your company want that? – jobukkit Mar 20 '15 at 14:51
1 Answers
0
Yes it is possible, but as the commenters have mentioned, definitely not recommended. SWT will not support this out of the box, as it is designed to have native looking widgets on whatever platform it is running on.
Swing, on the other hand, supports many different types of "look and feel", since it is designed to look the same on whatever platform you are running on. It won't be perfect (since again, it's not the native widget), but it's easier than writing your own widget.
Your options are:
- Use Swing for your widget. This related answer and this look and feel documentation are good starting points for doing this. There may be other look and feel implementations available that do a better job.
- Write a custom SWT widget that happens to look and feel like the button you want. This is pretty much extending from either Composite or Canvas, and implementing all the painting and behaviors yourself.
Keep in mind that with both of these solutions, your button will very quickly look out of date on newer versions of the OS if the native rendering of the button has changed.