cant see Decorations borders in swt-gtk [message #461836] |
Sun, 02 October 2005 10:01 |
Eclipse User |
|
|
|
Originally posted by: Manolo.localhost.localdomain
I create a example of Decorations, but when run it i can not see
Decoration close button, tittle of Decoration. I use
swt-gtk(libswt-pi-gtk-3138.so). The code of my example is this:
import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
/**
* This application shows the various styles of Decorations
*/
public class DecorationsExample {
/**
* Runs the application
*/
public void run() {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Decorations Example");
createContents(shell);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
/**
* Creates the various Decorations
*
* @param composite the parent composite
*/
public void createContents(Composite composite) {
// There are nine distinct styles, so create
// a 3x3 grid
composite.setLayout(new GridLayout(3, true));
// The SWT.CLOSE style
Decorations d = new Decorations(composite, SWT.CLOSE);
d.setLayoutData(new GridData(GridData.FILL_BOTH));
d.setLayout(new FillLayout());
new Label(d, SWT.CENTER).setText("SWT.CLOSE");
}
public static void main(String[] args) {
new DecorationsExample().run();
}
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.02572 seconds