Mercurial > projects > dwt-samples
annotate snippets/spinner/Snippet184.d @ 120:1f0a7a472680
fix rm snippets from module statements.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 20 Jul 2008 19:17:23 +0200 |
parents | 4a04b6759f98 |
children |
rev | line source |
---|---|
78 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2005 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Bill Baxter <bill@billbaxter.com> | |
12 *******************************************************************************/ | |
120
1f0a7a472680
fix rm snippets from module statements.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
13 module spinner.Snippet184; |
78 | 14 |
15 /* | |
16 * Spinner example snippet: create and initialize a spinner widget | |
17 * | |
18 * For a list of all DWT example snippets see | |
19 * http://www.eclipse.org/swt/snippets/ | |
20 * | |
21 * @since 3.1 | |
22 */ | |
23 import dwt.DWT; | |
24 import dwt.widgets.Display; | |
25 import dwt.widgets.Shell; | |
26 import dwt.widgets.Spinner; | |
27 | |
28 void main() { | |
29 Display display = new Display(); | |
30 Shell shell = new Shell(display); | |
31 Spinner spinner = new Spinner (shell, DWT.BORDER); | |
32 spinner.setMinimum(0); | |
33 spinner.setMaximum(1000); | |
34 spinner.setSelection(500); | |
35 spinner.setIncrement(1); | |
36 spinner.setPageIncrement(100); | |
37 spinner.pack(); | |
38 shell.pack(); | |
39 shell.open(); | |
40 while (!shell.isDisposed()) { | |
41 if (!display.readAndDispatch()) | |
42 display.sleep(); | |
43 } | |
44 display.dispose(); | |
45 } | |
46 |