[[BR]] [[BR]] [[BR]] === PLEASE NOTE: The info on this page is a bit outdated, for latest instructions go to [https://github.com/d-widget-toolkit/dwt GitHub] === [[BR]] [[BR]] [[BR]] [[BR]] = DWT Installation on Windows = ''recommended'' 1. Create a new empty directory without spaces in the name. 2. Download and extract [http://downloads.dsource.org/projects/tango/0.99.7/tango-0.99.7-bin-win32-dmd.1.033.zip tango], rename the "tango-0.99.7-bin-win32-dmd.1.033" to "tango" 3. Download and extract [http://www.dsource.org/projects/dsss/browser/downloads/0.75/dsss-0.75-dmd-win.zip dsss], rename the "dsss-0.75-dmd-win" to "dsss" 4. Download and extract the [http://downloads.dsource.org/projects/dwt/dwt-win-importlibs.zip import-libs] into the tango/lib directory, confirm to override some libs. 5. Download and extract the [wiki:Releases#Latest latest DWT release] (or as an option get the development snapshot from the [wiki:AccessMercurialRepo HG repositories]) 6. The directory has now "tango", "dsss", "dwt-win", "dwt-linux", "dwt-addons", "dwt-samples" 7. In an editor open dsss/etc/rebuild/default and edit to "dmd-win-tango" 8. In an editor open dsss/etc/rebuild/dmd-win-tango, search for "oneatatime" and change to "no" (twice!) 9. Open a console and set the system path with "{{{set PATH=C:\\dsss\bin;C:\\tango\bin;%PATH%}}}" ( is the created directory) 10. cd into dwt-samples\examples 11. run "{{{dsss build -dc=dmd-win-tango -full -I..\..\dwt-win controlexample\ControlExample.d}}}" (compilation should take about 20..30 sec) 12. run the compiled example program "{{{controlexample\ControlExample.exe}}}" = DWT Installation on Linux = ''recommended'' 1. Create a new empty directory without spaces in the name. 2. Download and extract [http://downloads.dsource.org/projects/tango/0.99.7/tango-0.99.7-bin-linux-dmd.1.033.tar.gz tango], rename the "tango-0.99.7-bin-linux-dmd.1.033" to "tango" 3. Download and extract [http://www.dsource.org/projects/dsss/browser/downloads/0.75/dsss-0.75-dmd-gnuWlinux-x86.tar.gz dsss], rename the "dsss-0.75-dmd-gnuWlinux-x86" to "dsss" 4. Ensure your linux distro has the packages "libgtk2.0-dev", "libxtst-dev", "libgnomeui-dev" installed (these are the names used in ubuntu linux) 5. Download and extract the [wiki:Releases#Latest latest DWT release] (or as an option get the development snapshot from the [wiki:AccessMercurialRepo HG repositories]) 6. The directory has now "tango", "dsss", "dwt-win", "dwt-linux", "dwt-addons", "dwt-samples" 7. In an editor open dsss/etc/rebuild/default and edit to "dmd-posix-tango" 8. In an editor open dsss/etc/rebuild/dmd-posix-tango, search for "oneatatime" and change to "no" (twice!) 9. Open a console and set the system path with "{{{export PATH=`pwd`/dsss/bin:`pwd`/tango/bin:$PATH}}}" 10. cd into dwt-samples/examples 11. run "{{{dsss build -dc=dmd-posix-tango -full -I../../dwt-linux controlexample/ControlExample.d}}}" (compilation should take about 20..30 sec) 12. run the compiled example program "{{{controlexample/ControlExample}}}" = Old installation instuctions = '''Requirements:''' Check the [wiki:Requirements Requirements] If you have all the prerequisites you can skip directly to step E. below. A. '''Install D 1.x Compiler'''[[BR]]There are several ways to get the D compiler. Two possible ways are: 1. Download from !DigitalMars (http://www.digitalmars.com/d/download.html) (See the [wiki:Requirements] for what version is know to be working) 2. Download Tango bundled with DMD - http://www.dsource.org/projects/tango/wiki/DmdDownloads. Check if the bundled compiler is know to work (See [wiki:Requirements]). If you choose this option, obviously you can skip step B below, installing Tango. [[BR]][[BR]]Hints on installing DMD: * Put the DMD files in a directory path without spaces * Put dmd/bin in some environment variable to be able to access DMD from the command line/terminal B. '''Install Tango'''[[BR]] Instructions for installing Tango are here: http://www.dsource.org/projects/tango/wiki/TopicInstallTango C. '''Install DSSS'''[[BR]] 1. Download latest DSSS - http://svn.dsource.org/projects/dsss/downloads/ 2. Unpack DSSS in directory path without spaces 3. Put dsss/bin in some environment variable to be able to access DSSS from the command line/terminal 4. Open dsss/etc/rebuild/default with a text editor 5. Change to one of the following: * profile=dmd-win-tango * profile=dmd-posix-tango 6. Change the oneatatime option in the DSSS compiler profile (dmd-win-tango or dmd-posix-tango) to oneatatime=off (twice) (Recommended for faster builds) D. '''Install Mercurial'''[[BR]] For more info see here - http://www.dsource.org/projects/dwt/wiki/AccessMercurialRepo E. '''Install DWT'''[[BR]] 1. Get DWT. There are three ways of getting DWT. I. Download the latest release from [wiki:Releases Releases] (recommended) II. Get the source repositories. This is recommended if you want always the latest source. Use the commands {{{ hg clone http://hg.dsource.org/projects/dwt-linux hg clone http://hg.dsource.org/projects/dwt-win hg clone http://hg.dsource.org/projects/dwt-samples hg clone http://hg.dsource.org/projects/dwt-addons }}} III. Download the latest snapshot directly from the Mercurial server (not recommended) 2. (Windows only) Download some additional libraries and put them in dmd/lib - [http://downloads.dsource.org/projects/dwt/dwt-win-importlibs.zip dwt-win-importlibs.zip] 4. In the command line/terminal, change into the newly created directory dwt-linux or dwt-win 5. Run "'''dsss build'''" to build DWT (add -version=TANGOSVN if you use Tango from SVN) 6. For your applications you can either install dwt into your dsss installation or use it as direct source. I. Run "'''dsss install'''" to install DWT. After the installation process you should be able to build a dwt application with dsss anywhere in your system and you DON'T have to rename anything. II. If building your applications add the -I option with the path to your dwt-linux/dwt-win directory to the dsss command line. This avoids potential problem with outdated libs. F. '''Testing your DWT installation'''[[BR]] 1. You can test DWT with the following example (a similar example can be found in the dwt-samples project, dwtexamples/simple.d): {{{ #!d module main; import dwt.widgets.Display; import dwt.widgets.Shell; void main () { Display display = new Display; Shell shell = new Shell(display); shell.setText = "Hello DWT World"; shell.open; while (!shell.isDisposed) if (!display.readAndDispatch) display.sleep; display.dispose; } }}} 2. Put the above code in a new file "main.d" into another directory[[BR]] 3. Create a minimal file named "dsss.conf" in the same directory as above[[BR]] {{{ [main.d] }}} Windows only, optional add this line to "dsss.conf" to suppress the console window {{{ buildflags+=-L/SUBSYSTEM:windows:5 }}} 4. Run "'''dsss build'''" in the same directory as above[[BR]] In case you get linker errors verify that: * on windows, that the location of the import libs is known to dsss also. To be sure you can give that path to dsss with -S"path" * that you did "'''dsss install'''" after building dwt 5. Run main [[BR]] [[BR]] == Further Information == '''Differences between SWT and DWT:'''[[BR]] * Change all package name from "org.eclipse.swt" to "dwt".[[BR]] * Change every "SWT" to "DWT".[[BR]] * Examples: * "org.eclipse.swt.widgets.Button" becomes "dwt.widgets.Button",[[BR]] * "org.eclipse.swt.SWT" becomes "dwt.DWT".[[BR]] [[BR]] '''Things added or changed in DWT:'''[[BR]] * `MessageBox` can have null as parent to allow a `MessageBox` without a Shell[[BR]] * There are five new static methods in `MessageBox`: * `showMessageBox` * `showInfo` * `showInformation` (an alias to `showInfo`) * `showWarning` * `showError` * Not everything has been ported yet.[[BR]] [[BR]] '''API documentation:'''[[BR]] The SWT API documentation works for DWT with minor changes:[[BR]] http://help.eclipse.org/stable/nftopic/org.eclipse.platform.doc.isv/reference/api/overview-summary.html [[BR]] [[BR]] '''Snippets and examples:''' The SWT snippets and examples work for DWT with minor changes: * http://www.eclipse.org/swt/snippets/ * http://www.eclipse.org/swt/examples.php * See also DWT-Samples - http://www.dsource.org/projects/dwt-samples