Giter Site home page Giter Site logo

dwt's Introduction

DWT - D Widget Toolkit

DWT is a library for creating cross-platform GUI applications. It's a port of the SWT Java library from Eclipse. DWT is compatible with D2 using the standard library (Phobos) and D1 using Tango.

Building

Building

  1. Install all the requirements

  2. Clone the repository buy running:

     $ git clone --recursive git://github.com/d-widget-toolkit/dwt.git
    
  3. Compile the base and SWT library by running:

     $ rdmd build base swt
    

If you use D1 with Tango, please replace rdmd build to rake. For example: $ rdmd build base swt -> $ rake base swt

Requirements

Windows

All required files are included in the repository.

Linux

For Ubuntu, use the packages below. For other systems use the corresponding packages available in the system package manager.

  • libcairo2-dev
  • libglib2.0-dev
  • libpango1.0-dev
  • libxfixes-dev
  • libxdamage-dev
  • libxcomposite-dev
  • libxcursor-dev
  • libxrandr-dev
  • libxi-dev
  • libxinerama-dev
  • libxtst-dev
  • libgtk2.0-dev
  • libgnomeui-dev

For D1

  • Tango
  • Ruby
  • Rake 0.8.x (included in Ruby 1.9)

Building Hello World

  1. Follow the build instructions above

  2. Enter the following code in a file called main.d:

    module main;
    
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Shell;
    
    void main ()
    {
        auto display = new Display;
        auto shell = new Shell;
        shell.open();
    
        while (!shell.isDisposed)
            if (!display.readAndDispatch())
                display.sleep();
    
        display.dispose();
    }
  3. Compile by running:
    For Windows:

$ dmd main.d -I<dwt>\imp -J<dwt>\org.eclipse.swt.win32.win32.x86\res -L+<dwt>\lib\ ^
  -L+org.eclipse.swt.win32.win32.x86.lib -L+dwt-base.lib -L/SUBSYSTEM:WINDOWS:4.0

For Linux:

$ dmd main.d -I<dwt>/imp -J<dwt>/org.eclipse.swt.gtk.linux.x86/res -L-L<dwt>/lib \
  -L-l:org.eclipse.swt.gtk.linux.x86 \
  -L-l:dwt-base -L-lgtk-x11-2.0 -L-lgdk-x11-2.0 -L-latk-1.0 -L-lgdk_pixbuf-2.0 \
  -L-lgthread-2.0 -L-lpangocairo-1.0 -L-lfontconfig -L-lXtst -L-lXext -L-lXrender \
  -L-lXinerama -L-lXi -L-lXrandr -L-lXcursor -L-lXcomposite -L-lXdamage -L-lX11 \
  -L-lXfixes -L-lpango-1.0 -L-lgobject-2.0 -L-lgmodule-2.0 -L-ldl -L-lglib-2.0 \
  -L-lcairo -L-lgnomeui-2

Where <dwt> is the path to where DWT was cloned.

Updating the Repository

$ git pull
$ git submodule update --init --recursive

Debugging

To enable debug build (symbols for debugging):

$ rdmd build DEBUG=1 base swt

Alternatively you can set the environment variable DEBUG to '1'.

Build the Snippets

$ rdmd build swtsnippets

To build a single snippet run:

$ rdmd build swtsnippets[Snippet107]

Show Available Rake Tasks

$ rdmd build -T

dwt's People

Contributors

jacob-carlborg avatar john-colvin avatar kntroh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.