Mercurial > projects > dwt-linux
view helloworld.d @ 58:a5c274fa5af9
extended helloworld crashing
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 12 Jan 2008 07:02:08 +0100 |
parents | 8f049b136add |
children | 8cec8f536af3 |
line wrap: on
line source
module helloworld; import dwt.SWT; import dwt.widgets.Display; import dwt.widgets.Shell; import dwt.widgets.Composite; import dwt.widgets.Button; 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.setSize(200, 200); Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); shell.setText("Simple SWT Sample"); //Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); auto comp = new Composite( shell, SWT.NONE ); Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); auto btn = new Button( shell, SWT.TOGGLE ); Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); btn.setBounds(40, 50, 50, 20); Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); btn.setText( "hey" ); 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); } }