Mercurial > projects > dwt2
comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet20.d @ 29:4e5843b771cc
First snippets buildable on windows
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 22 Mar 2009 19:55:00 +0100 |
parents | 69b1fa94a4a8 |
children | 9f4c18c268b2 |
comparison
equal
deleted
inserted
replaced
28:69b1fa94a4a8 | 29:4e5843b771cc |
---|---|
34 auto bar = new CoolBar (shell, SWT.BORDER); | 34 auto bar = new CoolBar (shell, SWT.BORDER); |
35 for (int i=0; i<2; i++) { | 35 for (int i=0; i<2; i++) { |
36 auto item = new CoolItem (bar, SWT.NONE); | 36 auto item = new CoolItem (bar, SWT.NONE); |
37 auto button = new Button (bar, SWT.PUSH); | 37 auto button = new Button (bar, SWT.PUSH); |
38 button.setText ("Button " ~ to!(char[])(i)); | 38 button.setText ("Button " ~ to!(char[])(i)); |
39 auto size = button.computeSize (SWT.DEFAULT, DWT.DEFAULT); | 39 auto size = button.computeSize (SWT.DEFAULT, SWT.DEFAULT); |
40 item.setPreferredSize (item.computeSize (size.x, size.y)); | 40 item.setPreferredSize (item.computeSize (size.x, size.y)); |
41 item.setControl (button); | 41 item.setControl (button); |
42 } | 42 } |
43 bar.pack (); | 43 bar.pack (); |
44 shell.setSize(300, 100); | 44 shell.setSize(300, 100); |