PLEASE NOTE: The info on this page is a bit outdated, for latest instructions go to GitHub





DWT Installation on Windows

recommended

  1. Create a new empty directory without spaces in the name.
  2. Download and extract tango, rename the "tango-0.99.7-bin-win32-dmd.1.033" to "tango"
  3. Download and extract dsss, rename the "dsss-0.75-dmd-win" to "dsss"
  4. Download and extract the import-libs into the tango/lib directory, confirm to override some libs.
  5. Download and extract the latest DWT release (or as an option get the development snapshot from the 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:\<dir>\dsss\bin;C:\<dir>\tango\bin;%PATH%" (<dir> 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 tango, rename the "tango-0.99.7-bin-linux-dmd.1.033" to "tango"
  3. Download and extract 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 latest DWT release (or as an option get the development snapshot from the 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 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:

  1. Download from DigitalMars (http://www.digitalmars.com/d/download.html) (See the 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 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

  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

For more info see here - http://www.dsource.org/projects/dwt/wiki/AccessMercurialRepo

E. Install DWT

  1. Get DWT. There are three ways of getting DWT.
    1. Download the latest release from Releases (recommended)
    2. 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
      
    3. Download the latest snapshot directly from the Mercurial server (not recommended)
  2. (Windows only) Download some additional libraries and put them in dmd/lib - dwt-win-importlibs.zip
  3. In the command line/terminal, change into the newly created directory dwt-linux or dwt-win
  4. Run "dsss build" to build DWT (add -version=TANGOSVN if you use Tango from SVN)
  5. For your applications you can either install dwt into your dsss installation or use it as direct source.
    1. 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.
    2. 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

  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
  3. 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
  1. 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
  2. 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".


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: