Progress bar question



Hi,
I am trying to get a progress bar to pulse while a forked process runs.
Here is my code:

execpid = vfork();
if (execpid == 0) {
        if ((execv("/bin/tar", execargs) < 0)) {
                fprintf(stderr, "exec error: %s\n", strerror(errno));
                abort();
        }
        _exit(0);
} else {
        while (waitpid(execpid, NULL, WNOHANG) == 0) {
                gtk_progress_bar_pulse(createbar);
        }
}
free(execargs);
return;

It seems that the updating of my app's interface doesn't occur
while this forked process is running. After it runs I do see the
progress indicator at some random position, but during the running
I don't see it move at all.. I have tried it with a very long process
(tarring a huge directory) to see if it was simply too fast for it to 
update, but that doesn't seem to be the case. In fact the button that
I hit to trigger this entire process never raises...

Any advice would be appreciated.
Thanks,
jbm



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