We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Updating the screen from event handler
Page Index Toggle Pages: 1
Updating the screen from event handler (Read 307 times)
Updating the screen from event handler
Aug 26th, 2008, 10:31am
 
Hi,

I use processing to create an interactive graphical representation of data stored in a database.

loading the datasets sometimes needs a little time and I would like to show the user something like a progress bar while the data is retrieved.

The updates to the data happens in mousePressed() and there seems to be no calls to draw() in that time.

Is there a way to update the screen from mousePressed() without doing all the hassle of backgrounding the data retrieval into an own thread?

regards
 Ilu
Re: Updating the screen from event handler
Reply #1 - Aug 26th, 2008, 2:50pm
 
Mouse and keyboard events are queued so that they run at the end of draw(), specifically to deal with the issue you cite.
Page Index Toggle Pages: 1