Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to close progress bar only after all asyncExecs?
How to close progress bar only after all asyncExecs? [message #800347] Thu, 16 February 2012 19:47 Go to next message
Eclipse UserFriend
I've implemented an swt progress bar, and it's working fine. The problem came when I inserted a statement to dispose of my display when I get a progress complete event.

If the progress happens very rapidly, the complete message comes before all of the progress events have been displayed, leading to the progress bar showing up very quickly and then disappearing before it shows 100%.

What I'd like to do is wait a few seconds after the complete message has been received before disposing of the display. For whatever reason I either can't get it to wait before disposing, or I get a Threading exception when I try to operate on the display.

Is there a standard way to do this? Any advice would be helpful.

Thanks,

-Josh
Re: How to close progress bar only after all asyncExecs? [message #805527 is a reply to message #800347] Thu, 23 February 2012 16:38 Go to previous message
Eclipse UserFriend
To do something after a delay has passed you can invoke
Display.timerExec() on the main thread. For an example of this see
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet60.java
..

Grant


On 2/16/2012 7:47 PM, Josh Hester wrote:
> I've implemented an swt progress bar, and it's working fine. The problem
> came when I inserted a statement to dispose of my display when I get a
> progress complete event.
>
> If the progress happens very rapidly, the complete message comes before
> all of the progress events have been displayed, leading to the progress
> bar showing up very quickly and then disappearing before it shows 100%.
>
> What I'd like to do is wait a few seconds after the complete message has
> been received before disposing of the display. For whatever reason I
> either can't get it to wait before disposing, or I get a Threading
> exception when I try to operate on the display.
>
> Is there a standard way to do this? Any advice would be helpful.
>
> Thanks,
>
> -Josh
Previous Topic:Setting XULRunner properties programmatically
Next Topic:Glib error when disposing a Combo under Linux
Goto Forum:
  


Current Time: Sun Jul 13 00:16:36 EDT 2025

Powered by FUDForum. Page generated in 0.02841 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top