Re: implementing bars in the meantime on of long work



On Wed 05 Dec 2001 02:17, Giovanni Masullo wrote:
> i would like to know the rite "theorical" way to implement a
> long job without losing the possibility of get user input.
> have i to create a secondary task to do the job, with the primary
> waiting for user input?
> is there a better way?
> and what if i want to implement a completion bar?
> there's anybody can help me?
> tanx in advance.

Exactly what you describe is what I just implemented in the program xftree. 
If you download the code from the CVS at sourceforge (xfce desktop 
environment) have a look at the code in file xtree_cpy.c you can see that 
with the tubo.c code it is very easy to create a child process which will 
communicate with the parent via stdout and stderr. All you have to do is 
provide functions for the parent to process stdout, stderr, and for the child 
to perform during the fork. Since stdout and stderr are used, your child can 
even exec some command line utility if necesary.

saludos

Edscott Wilson Garcia



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