Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Re: Re: How does one set the background on a Button with style SWT.PUSH or SWT.ARROW?

Saturday, January 7, 2006, 6:43:37 PM, Lodewijk Pool wrote:

> Thanks for your input Colin.

> For the interim I have implemented a rather notso-elegant solution by adding
> paintlistener to the button and then drawing a filled rectangle across the
> whole button, by setting the alpha of the colour to about .5 I achieve an
> affect that suits my needs well enough. This, however, does require an
> explicit redraw request on a selection event since, for some reason, the
> filled rectangle is removed whenever the button is pushed.

> In the meantime I am still hoping that there is a better way of doing this.

> Regards,
> Louis.

What you have done is a fine workaround for a win32 platform
limitation.  The native button simply does not allow you to
set its colors.  On other platforms (Linux GTK, MacOS), it
works fine.  Like you suggested, another option is a custom
(emulated) button widget.

-- 
Regards,
David                            
mailto:dlwhiteman@xxxxxxxxxxxxxxx
news://news.eclipse.org/eclipse.platform.swt
http://www.eclipse.org/newsportal/thread.php?group=eclipse.platform.swt




Back to the top