c++ - How to wait for GTK+ object to be destroyed before continuing? -
i have program open file dialog , take file name , resource intensive operations.
my problem while opertion running, though gtk_widget_destroy() has been called on file dialog stays open.
this problem because need implement loading bar in near future , don't want dialog hanging around. code looks this:
if(gtk_dialog_run(gtk_dialog(fileselect)) == gtk_response_ok){ filename = string(gtk_file_chooser_get_filename(gtk_file_chooser(fileselect))); gtk_widget_destroy(fileselect); }else{ gtk_widget_destroy(fileselect); return; } resourceintensivefunction();
so how can wait file dialog exit before continuing?
btw i'm using gtk 2.
so, found out how it, relatively simple.
while(gtk_events_pending()){ gtk_main_iteration_do(true); }
hope helped someone.
Comments
Post a Comment