PLEASE NOTE: The info on this page is a bit outdated, for latest instructions go to GitHub
DWT Installation on Windows
recommended
- Create a new empty directory without spaces in the name.
- Download and extract tango, rename the "tango-0.99.7-bin-win32-dmd.1.033" to "tango"
- Download and extract dsss, rename the "dsss-0.75-dmd-win" to "dsss"
- Download and extract the import-libs into the tango/lib directory, confirm to override some libs.
- Download and extract the latest DWT release (or as an option get the development snapshot from the HG repositories)
- The directory has now "tango", "dsss", "dwt-win", "dwt-linux", "dwt-addons", "dwt-samples"
- In an editor open dsss/etc/rebuild/default and edit to "dmd-win-tango"
- In an editor open dsss/etc/rebuild/dmd-win-tango, search for "oneatatime" and change to "no" (twice!)
- Open a console and set the system path with "set PATH=C:\<dir>\dsss\bin;C:\<dir>\tango\bin;%PATH%" (<dir> is the created directory)
- cd into dwt-samples\examples
- run "dsss build -dc=dmd-win-tango -full -I..\..\dwt-win controlexample\ControlExample.d" (compilation should take about 20..30 sec)
- run the compiled example program "controlexample\ControlExample.exe"
DWT Installation on Linux
recommended
- Create a new empty directory without spaces in the name.
- Download and extract tango, rename the "tango-0.99.7-bin-linux-dmd.1.033" to "tango"
- Download and extract dsss, rename the "dsss-0.75-dmd-gnuWlinux-x86" to "dsss"
- Ensure your linux distro has the packages "libgtk2.0-dev", "libxtst-dev", "libgnomeui-dev" installed (these are the names used in ubuntu linux)
- Download and extract the latest DWT release (or as an option get the development snapshot from the HG repositories)
- The directory has now "tango", "dsss", "dwt-win", "dwt-linux", "dwt-addons", "dwt-samples"
- In an editor open dsss/etc/rebuild/default and edit to "dmd-posix-tango"
- In an editor open dsss/etc/rebuild/dmd-posix-tango, search for "oneatatime" and change to "no" (twice!)
- Open a console and set the system path with "export PATH=`pwd`/dsss/bin:`pwd`/tango/bin:$PATH"
- cd into dwt-samples/examples
- run "dsss build -dc=dmd-posix-tango -full -I../../dwt-linux controlexample/ControlExample.d" (compilation should take about 20..30 sec)
- run the compiled example program "controlexample/ControlExample"
Old installation instuctions
Requirements:
Check the Requirements
If you have all the prerequisites you can skip directly to step E. below.
A. Install D 1.x Compiler
There are several ways to get the D compiler. Two possible ways are:
- Download from DigitalMars (http://www.digitalmars.com/d/download.html) (See the Requirements for what version is know to be working)
- Download Tango bundled with DMD - http://www.dsource.org/projects/tango/wiki/DmdDownloads. Check if the bundled compiler is know to work (See Requirements). If you choose this option, obviously you can skip step B below, installing Tango.
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
Instructions for installing Tango are here: http://www.dsource.org/projects/tango/wiki/TopicInstallTango
C. Install DSSS
- Download latest DSSS - http://svn.dsource.org/projects/dsss/downloads/
- Unpack DSSS in directory path without spaces
- Put dsss/bin in some environment variable to be able to access DSSS from the command line/terminal
- Open dsss/etc/rebuild/default with a text editor
- Change to one of the following:
- profile=dmd-win-tango
- profile=dmd-posix-tango
- 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
For more info see here - http://www.dsource.org/projects/dwt/wiki/AccessMercurialRepo
E. Install DWT
- Get DWT. There are three ways of getting DWT.
- Download the latest release from Releases (recommended)
- 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
- Download the latest snapshot directly from the Mercurial server (not recommended)
- (Windows only) Download some additional libraries and put them in dmd/lib - dwt-win-importlibs.zip
- In the command line/terminal, change into the newly created directory dwt-linux or dwt-win
- Run "dsss build" to build DWT (add -version=TANGOSVN if you use Tango from SVN)
- For your applications you can either install dwt into your dsss installation or use it as direct source.
- 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.
- 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
- 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; }
- Put the above code in a new file "main.d" into another directory
- Create a minimal file named "dsss.conf" in the same directory as above
[main.d]
Windows only, optional add this line to "dsss.conf" to suppress the console window
buildflags+=-L/SUBSYSTEM:windows:5
- Run "dsss build" in the same directory as above
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
- Run main
Further Information
Differences between SWT and DWT:
- Change all package name from "org.eclipse.swt" to "dwt".
- Change every "SWT" to "DWT".
- Examples:
- "org.eclipse.swt.widgets.Button" becomes "dwt.widgets.Button",
- "org.eclipse.swt.SWT" becomes "dwt.DWT".
- "org.eclipse.swt.widgets.Button" becomes "dwt.widgets.Button",
Things added or changed in DWT:
- MessageBox can have null as parent to allow a MessageBox without a Shell
- There are five new static methods in MessageBox:
- showMessageBox
- showInfo
- showInformation (an alias to showInfo)
- showWarning
- showError
- Not everything has been ported yet.
API documentation:
The SWT API documentation works for DWT with minor changes:
http://help.eclipse.org/stable/nftopic/org.eclipse.platform.doc.isv/reference/api/overview-summary.html
Snippets and examples: The SWT snippets and examples work for DWT with minor changes: