Mercurial > projects > dwt-samples
comparison snippets/tree/Snippet8.d @ 118:7b1c122b4128
Add version TANGOSVN
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 13 Jul 2008 00:51:55 +0200 |
parents | 4a04b6759f98 |
children | 1f0a7a472680 |
comparison
equal
deleted
inserted
replaced
117:8cdaac0dc743 | 118:7b1c122b4128 |
---|---|
29 import dwt.widgets.Tree; | 29 import dwt.widgets.Tree; |
30 import dwt.widgets.TreeItem; | 30 import dwt.widgets.TreeItem; |
31 | 31 |
32 import dwt.dwthelper.utils; | 32 import dwt.dwthelper.utils; |
33 import tango.io.FilePath; | 33 import tango.io.FilePath; |
34 version(TANGOSVN){ | |
35 import tango.io.FileSystem; | |
36 } | |
37 else{ | |
34 import tango.io.FileRoots; | 38 import tango.io.FileRoots; |
39 } | |
35 | 40 |
36 void main () { | 41 void main () { |
37 auto display = new Display (); | 42 auto display = new Display (); |
38 auto shell = new Shell (display); | 43 auto shell = new Shell (display); |
39 shell.setText ("Lazy Tree"); | 44 shell.setText ("Lazy Tree"); |
40 shell.setLayout (new FillLayout ()); | 45 shell.setLayout (new FillLayout ()); |
41 auto tree = new Tree (shell, DWT.BORDER); | 46 auto tree = new Tree (shell, DWT.BORDER); |
47 version(TANGOSVN){ | |
48 auto roots = FileSystem.roots(); | |
49 } | |
50 else{ | |
42 auto roots = FileRoots.list(); | 51 auto roots = FileRoots.list(); |
52 } | |
43 foreach (file; roots) { | 53 foreach (file; roots) { |
44 auto root = new TreeItem (tree, 0); | 54 auto root = new TreeItem (tree, 0); |
45 root.setText (file); | 55 root.setText (file); |
46 root.setData (new FilePath(file)); | 56 root.setData (new FilePath(file)); |
47 new TreeItem (root, 0); | 57 new TreeItem (root, 0); |