117
|
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 * Thomas Demmer <t_demmer AT web DOT de>
|
|
12 *******************************************************************************/
|
|
13 module caret.Snippet74;
|
|
14
|
|
15 /*
|
|
16 * Caret example snippet: create a caret
|
|
17 *
|
|
18 * For a list of all SWT example snippets see
|
|
19 * http://www.eclipse.org/swt/snippets/
|
|
20 */
|
|
21 import dwt.DWT;
|
|
22 import dwt.widgets.Caret;
|
|
23 import dwt.widgets.Display;
|
|
24 import dwt.widgets.Shell;
|
|
25
|
|
26 import dwt.dwthelper.utils;
|
|
27
|
|
28 void main (String [] args) {
|
|
29 Display display = new Display ();
|
|
30 Shell shell = new Shell (display);
|
|
31 Caret caret = new Caret (shell, DWT.NONE);
|
|
32 caret.setBounds (10, 10, 2, 32);
|
|
33 shell.open ();
|
|
34 while (!shell.isDisposed ()) {
|
|
35 if (!display.readAndDispatch ()) display.sleep ();
|
|
36 }
|
|
37 display.dispose ();
|
|
38 }
|
|
39
|