Re: [gtk-list] Re: coordinating idle events and redraws



On 12 Feb 1998, Owen Taylor wrote:

> 
> Marc Ewing <marc@redhat.com> writes:
> 
> > 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.
> 
> The problem (I think) is that what is queued up initially is
> not redraw requests but resize requests. Then you add your
> idle handler.
> 
> The resize requests get run, and add an idle handler for the
> redraw requests, your idler handler gets executed, then the
> redraw idle gets executed.
>  
> > Is there any way to get a function to run *after* all the redraws?
> 
> No good one that I can think of right now. (I suppose you could
> temporarily hook into the "draw" signal in one of the widgets and when
> it gets called (after the redraw requests are being executed) remove
> the handler and set up your idle handler.)
> 
> I think what is needed is priorities for the idle handlers.
> By default, the resize and redraw handlers should have a higher
> priority than the applications handlers, because from the
> applications point of view GTK isn't idle until it has 
> executed them. Going on the TODO list...

owen, wouldn't it be sufficient to have an internal idle queue?
i think a distinction needs only to be made for application idles
and gtk idles.

hm, priorities for idle handlers? is that implicating the question
"please, specify how idle you are:" or "shall i only run you if i'm
really lazy?" (just kidding here... ;)


> Regards,
>                                         Owen
> 

---
ciaoTJ



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