Mercurial > projects > dwt-addons
diff dwtx/ui/internal/forms/widgets/BusyIndicator.d @ 167:862b05e0334a
Add a wrapper for Thread
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 09 Sep 2008 15:59:16 +0200 |
parents | 7ffeace6c47f |
children |
line wrap: on
line diff
--- a/dwtx/ui/internal/forms/widgets/BusyIndicator.d Mon Sep 08 01:01:30 2008 +0200 +++ b/dwtx/ui/internal/forms/widgets/BusyIndicator.d Tue Sep 09 15:59:16 2008 +0200 @@ -35,13 +35,13 @@ import dwt.dwthelper.Runnable; import tango.util.Convert; -import tango.core.Thread; +import dwtx.dwtxhelper.JThread; public final class BusyIndicator : Canvas { alias Canvas.computeSize computeSize; - class BusyThread : Thread { + class BusyThread : JThread { Rectangle bounds; Display display; GC offScreenImageGC; @@ -56,7 +56,7 @@ this.offScreenImage = offScreenImage; } - public void run() { + public override void run() { try { /* * Create an off-screen image to draw on, and fill it with @@ -125,7 +125,7 @@ * Sleep for the specified delay time */ try { - Thread.sleep(MILLISECONDS_OF_DELAY/1000.0); + JThread.sleep(MILLISECONDS_OF_DELAY); } catch (InterruptedException e) { ExceptionPrintStackTrace(e); } @@ -221,8 +221,8 @@ Image offScreenImage = new Image(display, bounds.width, bounds.height); GC offScreenImageGC = new GC(offScreenImage); busyThread = new BusyThread(bounds, display, offScreenImageGC, offScreenImage); - busyThread.priority((Thread.PRIORITY_MIN + Thread.PRIORITY_MAX )/2 + 2); - busyThread.isDaemon(true); + busyThread.setPriority(JThread.NORM_PRIORITY + 2); + busyThread.setDaemon(true); busyThread.start(); }