Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2012-10-26 18:52:30 +0000
committerSilenio Quarti2012-10-26 18:52:30 +0000
commita886f16168f44eb14dce55165728859cc8ee3baa (patch)
tree77507a36826a1bbab089f5996d8b8b798895d212 /examples
parentd0069d7ed7376b10efa426e883f2b4851a6c7c22 (diff)
downloadeclipse.platform.swt-a886f16168f44eb14dce55165728859cc8ee3baa.tar.gz
eclipse.platform.swt-a886f16168f44eb14dce55165728859cc8ee3baa.tar.xz
eclipse.platform.swt-a886f16168f44eb14dce55165728859cc8ee3baa.zip
Bug 392841 - [GTK3] Need to replace expose-event signal with draw signal
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet1.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet1.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet1.java
index 7ba0b1ce28..ac58a725c2 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet1.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet1.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.swt.snippets;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.layout.*;
/*
* example snippet: Hello World
*
@@ -23,6 +26,58 @@ public class Snippet1 {
public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell(display);
+
+//// Cursor cursor = display.getSystemCursor(SWT.CURSOR_APPSTARTING);
+//// ImageData s = new ImageData(32, 32, 1, new PaletteData(new RGB[]{new RGB(0, 0, 0), new RGB(255, 255, 255)}));
+//// ImageData m = new ImageData(32, 32, 1, new PaletteData(new RGB[]{new RGB(0, 0, 0), new RGB(255, 255, 255)}));
+//// for (int i=0; i<s.data.length; i++) {
+//// s.data[i] = (byte)0xFF;
+//// }
+//// for (int i=0; i<s.data.length; i++) {
+////// m.data[i] = (byte)0xFF;
+//// }
+////
+//// Cursor cursor = new Cursor(display, s, m, 10, 10);
+//
+//// ImageData mask = new ImageData("/home/test/git/eclipse.platform.ui/bundles/org.eclipse.ui/icons/full/pointer/bottom_mask.bmp");
+//// ImageData source = new ImageData("/home/test/git/eclipse.platform.ui/bundles/org.eclipse.ui/icons/full/pointer/bottom_source.bmp");
+//// ImageData mask = new ImageData("/home/test/git/eclipse.platform.ui/bundles/org.eclipse.ui/icons/full/pointer/offscreen_mask.bmp");
+//// ImageData source = new ImageData("/home/test/git/eclipse.platform.ui/bundles/org.eclipse.ui/icons/full/pointer/offscreen_source.bmp");
+//// ImageData mask = new ImageData("/home/test/git/eclipse.platform.ui/bundles/org.eclipse.ui/icons/full/pointer/invalid_mask.bmp");
+//// ImageData source = new ImageData("/home/test/git/eclipse.platform.ui/bundles/org.eclipse.ui/icons/full/pointer/invalid_source.bmp");
+// ImageData mask = new ImageData("/home/test/git/eclipse.platform.ui/bundles/org.eclipse.ui/icons/full/pointer/left_mask.bmp");
+// ImageData source = new ImageData("/home/test/git/eclipse.platform.ui/bundles/org.eclipse.ui/icons/full/pointer/left_source.bmp");
+// Cursor cursor = new Cursor(display, mask, source, 10, 10);
+//
+//// Cursor cursor = new Cursor(display, new ImageData("/home/test/icons/oil-logo-v1.0.png"), 0, 0);
+//
+// shell.setCursor(cursor);
+
+// Link link = new Link(shell, SWT.BORDER);
+// link.setText("a like <a>Silenio</a> now");
+// link.setSize(300, 30);
+
+ shell.setLayout(new GridLayout(1, false));
+
+// Button b = new Button(shell, SWT.PUSH);
+// b.setText("Button");
+// Text text = new Text(shell, SWT.SINGLE | SWT.BORDER);
+// text.setMessage("Hello wolrd");
+
+ shell.setBackgroundImage(new Image(display, "/home/test/icons/oil-logo-v1.0.png"));
+ shell.setBackgroundMode(SWT.INHERIT_FORCE);
+
+ Table table = new Table(shell, SWT.MULTI);
+ for (int i=0; i<4; i++) {
+
+ }
+ table.addListener(SWT.Paint, new Listener() {
+ public void handleEvent(Event event) {
+ event.gc.drawLine(0, 0, 100, 100);
+ }
+ });
+
+
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();

Back to the top