comparison dwtsnippets/styledtext/Snippet163.d @ 22:40dae5136e84

Porting comment
author Frank Benoit <benoit@tionex.de>
date Sun, 02 Mar 2008 18:46:18 +0100
parents 7b7a54b047e1
children
comparison
equal deleted inserted replaced
21:96a7ecc03d98 22:40dae5136e84
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
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * D Port: 10 * Port to the D programming language:
11 * Jesse Phillips <Jesse.K.Phillips+D> gmail.com 11 * Jesse Phillips <Jesse.K.Phillips+D> gmail.com
12 *******************************************************************************/ 12 *******************************************************************************/
13 13
14 module dwtsnippets.styledtext.Snippet163; 14 module dwtsnippets.styledtext.Snippet163;
15 15
23 import dwt.custom.StyledText; 23 import dwt.custom.StyledText;
24 import dwt.custom.StyleRange; 24 import dwt.custom.StyleRange;
25 import dwt.layout.FillLayout; 25 import dwt.layout.FillLayout;
26 import dwt.widgets.Display; 26 import dwt.widgets.Display;
27 import dwt.widgets.Shell; 27 import dwt.widgets.Shell;
28
29 version(JIVE){
30 import jive.stacktrace;
31 }
28 32
29 void main() { 33 void main() {
30 auto display = new Display(); 34 auto display = new Display();
31 auto shell = new Shell(display); 35 auto shell = new Shell(display);
32 shell.setLayout(new FillLayout()); 36 shell.setLayout(new FillLayout());
48 auto style3 = new StyleRange(); 52 auto style3 = new StyleRange();
49 style3.start = 25; 53 style3.start = 25;
50 style3.length = 13; 54 style3.length = 13;
51 style3.background = display.getSystemColor(DWT.COLOR_BLUE); 55 style3.background = display.getSystemColor(DWT.COLOR_BLUE);
52 text.setStyleRange(style3); 56 text.setStyleRange(style3);
53 57
54 shell.pack(); 58 shell.pack();
55 shell.open(); 59 shell.open();
56 while (!shell.isDisposed()) { 60 while (!shell.isDisposed()) {
57 if (!display.readAndDispatch()) 61 if (!display.readAndDispatch())
58 display.sleep(); 62 display.sleep();