Re: Update Progressbar using SIGALRM fails. Are there alternatives?



From: "R. Lahaye" <lahaye users sourceforge net>

I want to use the activity-progressbar to indicate
the activity of a time-consuming function call.

You'll have to run the "time-consuming function" in a separate thread or
process.

PS: I'm not at all familiar with fork(), but could that provide
a solution? Having a child process with an alarm set to 500 millisec?

Don't run the big function in the main process. Update the progress bar in
the main process. Run the function in a child process. You could have the
child process talk to the main process over a pipe, giving he main process
updates. You can use the G_IO functions to read the pipe. It might be better
to use a thread, though.




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