Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] GC on native components and painting

Hi.

I've followed the guide on http://www.eclipse.org/articles/Article-SWT-images/graphics-resources.html#Transparency
to find out how to do transparency.

I've added a paintlistener on a button however, when you go to click on the button there seems to be no refresh so it appears as if a image as disappeared.

It looks like there's another paint listener when the button is pressed so what I've done is made the button repaint everytime the mouse down and mouse up event occurs and that seems to be a nice work around. However, I've got lots of buttons/toolbar items that have images and adding mouse listeners to all the buttons makes code look really messy IMHO. Since I can't just extend the Button so that it encapsulates the extra repainting behaviour, is another way to approach this problem?

BTW, I'm running this on the windows version of SWT.



Back to the top