On Fri, 2010-04-23 at 10:17 -0800, fpiraneo wrote:
> Adam Tauno Williams-3 wrote:
> > I'd just start the computation in a thread and update the progress bar
> > via Application.Invoke.
> ...and without using threading?

If you are just using a Glib.Timeout it won't work for a single threaded
app unless you occasionally release to the event loop.

You'd have to change your processing to periodically pause - that really
is all up to whatever processing you are doing.  If it is an iteration
you should make sure you run the message queue every X number of loops.

Are you running your processing in an Idle handler?   

Or you could do something of the following pattern:

void LongComputation ()
{
     while (!done){
         ComputationChunk ();
 
         // Flush pending events to keep the GUI reponsive
         while (Gtk.Application.EventsPending ())
              Gtk.Application.RunIteration ();
     }
}

<http://www.mono-project.com/Responsive_Applications>

This makes sure all the pending events are processed between chunks of your 
long computation.
-- 
Adam Tauno Williams <[email protected]> LPIC-1, Novell CLA
<http://www.whitemiceconsulting.com>
OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba

_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to