coordinating idle events and redraws



I've got a gtktree widget, which builds itself dynamically as you
click on the entries, using the "expand" signal.  Some of these
expansions take quite a while so the first thing I do is a
gdk_window_set_cursor() to put up a watch cursor.  Then I go and
do the expansion, making the new subtree, appending treeitems, etc.
At the end I want to change the cursor back to normal.  If I do
it right away, the cursor changes back to normal, and the the big
redraw of the widget happens - wrong order.  So I set up a one time
idle function to reset the cursor.  But, it appears that idle
handlers are run *before* the queued up redraws for the widget.

Is there any way to get a function to run *after* all the redraws?

On a similar note, the "idle" handlers seem to be misnamed.  They
don't run on idle (ie when there are no other events/whatever to
take care of) at all.  They run at the next gtk_main_iteration_do().

I could be misunderstanding all of this (it's actually likely that
I am).  Can anyone shed any light on this?

Thanks,
Marc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]