Hello and welcome to the GTK+ forums.
This is one of the most common problems newcomers encounter when trying to execute a task that will take some time to finish from within callback handler. Why is this problem? Because callback handlers block main loop that updates the GUI, so no refreshing is done while lengthy task is running.
There are two solutions to this problem: the easy and ugly one; and the hard and right one.
The easy one involves calling this snippet of code whenever one wishes to update GUI and process any pending events:
while( gtk_events_pending() )
As I said, this is considered an ugly hack that tend to get abused when task in question is executed in some kind of loop.
The right thing to do when you need to execute lengthy task is to either run it in separate thread or spawn another process and monitor it from main application. Glib offers cross-platform infrastructure for both of these methods: GThreads
for threading support and spawning support
launching external applications.
I hope this introduction helped a bit. For more information on threads, you can check out my blog post here: http://tadeboro.blogspot.com/2009/06/multi-threaded-gtk-applications.html
. I'm currently writing post on spawning, so check out my blog in a few days for even more info.