Sure, just run the main loop:
while(gtk_events_pending())
gtk_main_iteration();
See the GTK+ documentation, which recommends the above with:
Checks if any events are pending.
This can be used to update the UI and invoke timeouts etc. while doing some time intensive computation.