Canvas on Ubuntu 14 not working? [message #1399921] |
Sun, 13 July 2014 11:30 |
Simon Mising name Messages: 12 Registered: December 2011 |
Junior Member |
|
|
Hi,
Iam using SWT Canvas to create custom widgets.
It all works fine on Windows Client, but if I start the Eclipse RCP based application on Ubuntu 14, the canvas just looks gray.
I attached to screenshots, how it looks on Ubuntu (linux.png) and how it should look (windows.png).
The widget class is quite straight forward:
public class ListEntry extends Composite{
private final Canvas canvas;
...
public ListEntry(Composite parent, int height, int style) {
super(parent, style);
setBackground(parent.getBackground());
setLayout(new FillLayout());
canvas = new Canvas(this, SWT.NO_BACKGROUND);
canvas.setBackground(parent.getBackground());
canvas.addPaintListener(new StatusPaintListener());
}
...
private class StatusPaintListener implements PaintListener {
@Override
public void paintControl(PaintEvent e) {
Image image = new Image(Display.getCurrent(), canvas.getBounds());
GC gcImage = new GC(image);
//Drawing stuff
...
// Draw the offscreen buffer to the screen
e.gc.drawImage(image, 0, 0);
image.dispose();
gcImage.dispose();
e.gc.dispose();
}
}
If you need the complete source code, just tell me.
Is there any common problem with SWT canvas on Ubuntu/Linux?
FYI
I am using Oracle Java 8.
Thanks for your help and greetings from Germany
Simon
-
Attachment: linux.PNG
(Size: 2.18KB, Downloaded 174 times) -
Attachment: windows.PNG
(Size: 1.83KB, Downloaded 171 times)
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02999 seconds