Mercurial > projects > dwt-samples
annotate snippets/directorydialog/Snippet33.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, 2004 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 *******************************************************************************/ | |
120
1f0a7a472680
fix rm snippets from module statements.
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
13 module directorydialog.Snippet33; |
78 | 14 |
15 /* | |
16 * DirectoryDialog example snippet: prompt for a directory | |
17 * | |
18 * For a list of all SWT example snippets see | |
19 * http://www.eclipse.org/swt/snippets/ | |
20 */ | |
21 | |
22 import dwt.widgets.DirectoryDialog; | |
23 import dwt.widgets.Display; | |
24 import dwt.widgets.Shell; | |
25 | |
26 import tango.io.FileSystem; | |
27 import tango.io.Stdout; | |
28 import tango.util.Convert; | |
29 | |
30 void main () { | |
31 auto display = new Display (); | |
32 auto shell = new Shell (display); | |
33 shell.open (); | |
34 auto dialog = new DirectoryDialog (shell); | |
35 dialog.setFilterPath (FileSystem.getDirectory()); | |
36 Stdout("RESULT=" ~ to!(char[])(dialog.open())).newline; | |
37 while (!shell.isDisposed()) { | |
38 if (!display.readAndDispatch ()) display.sleep (); | |
39 } | |
40 display.dispose (); | |
41 } |