[Gtk-sharp-list] s.w.f Application.DoEvents() equivalent for GTK#?

Jonathan Pryor jonpryor at vt.edu
Thu Oct 6 07:10:37 EDT 2005


On Wed, 2005-10-05 at 23:47 -0500, Michael Lee Yohe wrote:
> Is there an equivalent in GTK# for Application.DoEvents()? 
> Application.DoEvents() informs the main event handler (the main loop)
> to process all pending updates to widgets (and background events) that
> have built up until the method was called.

GLib.MainContext.Iteration() lets one iteration of event handlers
execute, but that won't necessarily clean up *all* the pending events.
To let all pending events execute, do this:

	while (GLib.MainContext.Iteration ())
		;

Note the empty while loop -- GLib.MainContext.Iteration() returns
whether or not there are more events pending.

 - Jon




More information about the Gtk-sharp-list mailing list