Re: Hide window while "busy"




Ingvar Tjostheim on February 6, 2004 wrote:
I'm not too good with GTK yet, and need help with what probably is a simple problem.

When the user pushes a button in a window my program starts a pretty long process.
During this process I want the window to disappear, but when calling either
     gtk_widget_destroy(data);
or
     gtk_widget_hide(data);
the window becomes disabled, but is still there.
I think that's because gtk_main is waiting for the button-function to finish, and the button-function is 
waiting for the process.

With gtk_main_quit you can do like this:
   gtk_widget_destroy(GTK_WIDGET(data));
   while (g_main_iteration(FALSE)) 
   gtk_main_quit();
to close the window in the same situation, but that does not work with gtk_widget_destroy or hide.

Is there another way?

Thanks!
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

This sort of problem snagged me for a long time too. What I think
will work here is connecting a handler to the unmap_event signal of
the window, and only performing your long process after that signal
handler is called. This technique is what the gtk_widget_show_now
function uses, in a parallel way.

 - Jesse



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