On Wed, 2004-04-21 at 12:11 -0700, Peter Rowat wrote:
I want to call a compute-intensive function as fast as possible. gtk_timeout_add doesn't appear to let me do this. If I set the interval too small (e.g. 1) the function doesn't get called. I tried setting the interval to 0 or -1 in case this would do what I want but no luck. I can guess/test the minimum interval to use, but this will vary. Is there some other way to have the GTK-main loop call a function as fast as possible? Or, could someone add this to gtk_timeout_add? -- Peter Rowat
In this case, you may be better off doing the computations in a separate thread, and updating the UI (or whatever) from an idle function in the main thread -- or from inside the computation thread. http://docs.linux.cz/gtk-faq/x462.html (the FAQ on gtk.org appears to be missing) g_idle_add_full () will let you control the priority of the idle handler -- you can set it to just below the priority of GTK+ UI events to allow redrawing and such to work. http://www.gtk.org/tutorial/ch-timeouts.html -- Peace, Jim Cape http://ignore-your.tv "We still name our military helicopter gunships after victims of genocide. Nobody bats an eyelash about that: Blackhawk. Apache. And Comanche. If the Luftwaffe named its military helicopters Jew and Gypsy, I suppose people would notice." -- Noam Chomsky, "Propaganda and the Public Mind"
Attachment:
signature.asc
Description: This is a digitally signed message part