Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » GUI not refreshing during long-running operations
GUI not refreshing during long-running operations [message #137645] Mon, 29 September 2003 21:33 Go to next message
Eclipse User
Originally posted by: kharris.unveil.com

I have a wizard which performs some long running operations when one pages
from one wizard page to the next. I have the body of each of these
operations in an IRunnableWithProgress and get progress updates which
advance the wizard's progress monitor as expected. The problem arises when I
select another window on my desktop. If I select my wizard again, the dialog
is not refreshed. If the window I previous brought into focus overlapped the
wizard, when I bring the wizard back into focus the region of overlap is now
completely blank. The GUI does not refresh itself until there's a progress
monitor update (which for me is somewhat infrequent.) Is there some way to
grab the focus event and refresh the GUI?

Also, the wizard dialog has a cancel button, but it's disabled during
long-running operations. Is there any way to enable it and interrupt the
process?

Thanks!
Karen
Re: GUI not refreshing during long-running operations [message #137681 is a reply to message #137645] Mon, 29 September 2003 21:44 Go to previous messageGo to next message
Eclipse User
Originally posted by: richkulp.NO--SPAM.us.ibm.com

It sounds like you didn't fork to another thread to do the long-running
operation. If you are doing the long-running work in the ui thread your
ui will not repaint.

Rich
Re: GUI not refreshing during long-running operations [message #139545 is a reply to message #137681] Fri, 03 October 2003 20:38 Go to previous messageGo to next message
Jiri Walek is currently offline Jiri Walek
Messages: 14
Registered: July 2009
Junior Member
If there is a cycle on GUI thread interupted by
progresMonitor.worked(1)
while the GUI is not refreshed in that time?

It seems that GUI is able to repaint for some short time (even if there is a
cycle) and than it stops.

I could hardly understand that.
I understand that if I don't call the progress monitor the ui thread is
completly busy with running operation, but I was thinking that if I call the
progress monitor the UI whould make itself repaint.

Where am I wrong?

I know that I there is no problem if the operation is working on
not-ui-thread.
But in my case I could not fork on another thread cause the simple data
layer that operates only in single thread architecture.

Jiri



"Richard L. Kulp" <richkulp@NO--SPAM.us.ibm.com> p
Re: GUI not refreshing during long-running operations [message #144259 is a reply to message #139545] Wed, 15 October 2003 07:01 Go to previous messageGo to next message
Jiri Walek is currently offline Jiri Walek
Messages: 14
Registered: July 2009
Junior Member
I made more observations and I have found that if I run the cycle on UI
thread interupted by monitor.worked(1)
the UI keeps itself fresh untill I don't switch to another window (or
minimize,...).

Test:
Win XP
Eclipse 2.1
Wizard that runs a long operation using wizard's progressMonitor.

Result:
UI is refreshing properly untill I switch off and back to the eclipse
app.

Q:
Can somebody explain this situation?

Jiri

"Jiri Walek" <walekj@dev.disnet.cz> p
Re: GUI not refreshing during long-running operations [message #144436 is a reply to message #144259] Wed, 15 October 2003 15:21 Go to previous message
Eclipse User
Originally posted by: richkulp.NO--SPAM.us.ibm.com

It is because you are not running the read/dispatch loop. The
read/dispatch loop handles requests that are queued up, including the
give focus request and paint requests. When doing the monitor.worked(1)
it probably just does an immediate paint to the monitor, the rest of the
ui is starved of events. And since the rest of the ui hasn't changed or
been covered, it looks like it is active and maintained, but it isn't.
It is just whatever it was last before your operation started.

That is why you should never do long running things in the ui thread, it
starves the read/dispatch loop and events do not get processed.

Rich
Previous Topic:Someone on these groups has a virus
Next Topic:M4 IRemoteResource api question
Goto Forum:
  


Current Time: Tue Sep 30 11:59:46 GMT 2014

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

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