How to close progress bar only after all asyncExecs? [message #800347] |
Thu, 16 February 2012 19:47  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02841 seconds