Bug 134501 - Decorations in Linux/GTK are not working as expected
Summary: Decorations in Linux/GTK are not working as expected
Status: CLOSED DUPLICATE of bug 29891
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-03 09:34 EDT by Alberto Polverini CLA
Modified: 2006-04-04 04:15 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Polverini CLA 2006-04-03 09:34:39 EDT
I have a small snippet that in windows show a Decorations widget inside a simple shell.

When I use the same in linux it sow an empty box. I suppose it is a bug because the functionality requested are very common and the code is so little that the problem should be somewere else.

I am using SUSE Linux 9.3 and I had a previous problem caused by the gtk-qt-engine package which affected the behaviour of colors in SWT so we have removed that package. For the rest is a standard installation of SUSE from the box.

Here there is the simple snippet.

package core;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Decorations;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Application {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		final Display display = new Display();
		final Shell shell = new Shell(display);
		shell.setText("Test");
		shell.setSize(300, 300);
		
		Decorations decorations = new Decorations(shell,SWT.CLOSE|SWT.RESIZE);
		decorations.setLocation(20,20);
		decorations.setSize(200,200);
		decorations.setBackground(new Color(shell.getDisplay(),100,200,100));
		decorations.setVisible(true);
		
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}

}

if somebody has a similar problem or know how to fix it would be very appreciated.

Thanks
Alberto
Comment 1 Veronika Irvine CLA 2006-04-03 15:21:43 EDT
From the javadoc for Decorations:

"IMPORTANT: This class was intended to be abstract and should <em>never</em> be referenced or instantiated. Instead, the class <code>Shell</code> should be used."

The MDI style which you are using on Windows is not supported on any other platform.
Comment 2 Steve Northover CLA 2006-04-03 15:59:14 EDT

*** This bug has been marked as a duplicate of 29891 ***
Comment 3 Alberto Polverini CLA 2006-04-04 04:15:55 EDT
sorry for the duplication, I close it.