view helloworld.d @ 54:8f049b136add

first example working
author Frank Benoit <benoit@tionex.de>
date Fri, 11 Jan 2008 14:31:37 +0100
parents f0cac58ac62b
children a5c274fa5af9
line wrap: on
line source

module helloworld;

import dwt.SWT;
import dwt.widgets.Display;
import dwt.widgets.Shell;

import tango.io.Stdout;
import tango.math.Math;
import tango.text.convert.Format;
import tango.util.Convert;
import tango.util.PathUtil;
import dwt.graphics.Device;
import dwt.graphics.ImageData;


import dwt.accessibility.AccessibleObject;
import dwt.accessibility.AccessibleFactory;
import dwt.SWT;
import dwt.dwthelper.File;
import dwt.widgets.Display;
import dwt.internal.Library;
import dwt.internal.Platform;
import dwt.internal.image.PngChunk;
import dwt.internal.image.JPEGFileFormat;
import dwt.internal.gtk.OS;

import jive.stacktrace;

void main(){

    TraceConfig.throwOnAll = true;
    try{
        Display display;
        Shell shell;

        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); File.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); Library.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); Platform.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); OS.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); SWT.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); AccessibleObject.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); AccessibleFactory.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); ImageData.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); Device.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); Display.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); PngChunk.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); JPEGFileFormat.static_this();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ );

        Stdout.formatln( "main entered" );
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); display = new Display();
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); shell = new Shell(display);
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); shell.setText("Simple SWT Sample");
        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); shell.open();
        Stdout.formatln( "loop entered" );
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) {
                display.sleep();
            }
        }
    }
    catch (Exception e)
    {
        Stdout.formatln (e.toString);
    }
}