comparison snippets/button/Snippet293.d @ 78:4a04b6759f98

Clean up directory names
author John Reimer <terminal.node@gmail.com>
date Sat, 10 May 2008 13:32:45 -0700
parents
children 8cdaac0dc743
comparison
equal deleted inserted replaced
76:04f122e90b0a 78:4a04b6759f98
1 /*******************************************************************************
2 * Copyright (c) 2000, 2008 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 * D Port:
11 * Jesse Phillips <Jesse.K.Phillips+D> gmail.com
12 *******************************************************************************/
13 module snippets.button.Snippet293;
14
15 /*
16 * create a tri-state button.
17 *
18 * For a list of all SWT example snippets see
19 * http://www.eclipse.org/swt/snippets/
20 */
21 import dwt.DWT;
22 import dwt.layout.GridLayout;
23 import dwt.widgets.Display;
24 import dwt.widgets.Shell;
25 import dwt.widgets.Button;
26
27 void main() {
28 auto display = new Display();
29 auto shell = new Shell(display);
30 shell.setLayout(new GridLayout());
31
32 auto b1 = new Button (shell, DWT.CHECK);
33 b1.setText("State 1");
34 b1.setSelection(true);
35
36 auto b2 = new Button (shell, DWT.CHECK);
37 b2.setText("State 2");
38 b2.setSelection(false);
39
40 auto b3 = new Button (shell, DWT.CHECK);
41 b3.setText("State 3");
42 b3.setSelection(true);
43
44 // This function does not appear in the api for swt 3.3
45 // b3.setGrayed(true);
46
47 shell.pack();
48 shell.open();
49 while (!shell.isDisposed()) {
50 if (!display.readAndDispatch())
51 display.sleep();
52 }
53 display.dispose();
54 }