Re: Wait until widget is shown



On Thu, Mar 09, 2006 at 03:03:25PM -0800, Micah Carrick wrote:
> I have a function that will take some time to run.. actually, it forks 
> out another process which can take up to say 4 seconds.  I want to 
> display a modal dialog during this time, or perhaps just a statusbar 
> message.  In any case, whatever I do does not show up until AFTER the 
> process is finished (and thus only shows up for an isntance).
> 
> I thought I could maybe create a global flag that is set right before 
> gtk_widget_show() , and is cleared once the "show" signal occurs for 
> that widget, and then have an infinate loop waiting for that flag to be 
> clear before calling that process.  This bothers me because of the 
> infinate loop and because it just seems like there's likely a better 
> way. Like is therea function call that allows pending redraws or 
> whatever to complete before continuing?

Yes, it is: gtk_main_iteration_do() (see also documentation
of gtk_events_pending()).

Yeti


--
That's enough.



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