Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Skins support and changing colours

Veronika Irvine wrote:

I've seen on internet explorer that you can add skins to toolbars and other widgets. can this be done in swt?

See:
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/faq.html#xpthemes
Thanks. It's too bad I'm not using win XP. I've seen it done

Also, is there a way to change colours on native windows widgets (other than changing the whole colour scheme for the operating system)?

Use the setBackground method of the particular widget.

Doesn't seem work. I remember bring this topic up before.

David Whiteman wrote:

> This should be an FAQ somewhere, but this is just a platform
> restriction on Windows. The standard Microsoft Button control just doesn't > support background colors. You can either paint the color & text yourself
> using a GC on the button, or you can develop your own custom widget,
> if you've got to have the background color.

I'm trying to avoid writing a button widget, but I'm not sure how I'd go about getting a gc on a button.
From the snippets, this seems to be the only way I can change it.
   button.addPaintListener(new PaintListener()
     {
        public void paintControl(PaintEvent e)
        {
e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
        }
     });

but it doesn't work, and the color still stays grey.



Back to the top