Skip to main content
summaryrefslogtreecommitdiffstats
blob: ac58a725c28a50470682a46d2053deda0a0d98ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.swt.snippets;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
/* 
 * example snippet: Hello World
 *
 * For a list of all SWT example snippets see
 * http://www.eclipse.org/swt/snippets/
 */
import org.eclipse.swt.widgets.*;

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 ();
	}
	display.dispose ();
}
}

Back to the top