Mercurial > projects > dwt-samples
comparison dwtsnippets/table/Snippet144.d @ 39:8ee0dfe6f685
Snippet134 with non rectangular shell. Some more minor fixes.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 13 Mar 2008 23:53:38 +0100 |
parents | 580d6cc14afd |
children |
comparison
equal
deleted
inserted
replaced
38:3dc632b3f71b | 39:8ee0dfe6f685 |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2004 IBM Corporation and others. | 2 * Copyright (c) 2000, 2004 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
5 * which accompanies this distribution, and is available at | 5 * which accompanies this distribution, and is available at |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
15 /* | 15 /* |
16 * Virtual Table example snippet: create a table with 1,000,000 items (lazy) | 16 * Virtual Table example snippet: create a table with 1,000,000 items (lazy) |
17 * | 17 * |
18 * For a list of all SWT example snippets see | 18 * For a list of all SWT example snippets see |
19 * http://www.eclipse.org/swt/snippets/ | 19 * http://www.eclipse.org/swt/snippets/ |
20 * | 20 * |
21 * @since 3.0 | 21 * @since 3.0 |
22 */ | 22 */ |
23 import dwt.DWT; | 23 import dwt.DWT; |
24 import dwt.widgets.Button; | 24 import dwt.widgets.Button; |
25 import dwt.widgets.Display; | 25 import dwt.widgets.Display; |
59 public void handleEvent (Event event) { | 59 public void handleEvent (Event event) { |
60 StopWatch elapsed; | 60 StopWatch elapsed; |
61 elapsed.start; | 61 elapsed.start; |
62 table.setItemCount (COUNT); | 62 table.setItemCount (COUNT); |
63 auto t = elapsed.stop; | 63 auto t = elapsed.stop; |
64 label.setText ("Items: " ~ to!(char[])(COUNT) ~ | 64 label.setText ("Items: " ~ to!(char[])(COUNT) ~ |
65 ", Time: " ~ to!(char[])(t) ~ " (ms)"); | 65 ", Time: " ~ to!(char[])(t) ~ " (sec)"); |
66 shell.layout (); | 66 shell.layout (); |
67 } | 67 } |
68 }); | 68 }); |
69 shell.pack (); | 69 shell.pack (); |
70 shell.open (); | 70 shell.open (); |