Re: g_spawn_async use



El mié, 18 de 06 de 2003 a las 07:59, Alexis Sukrieh escribió:
Hello list :)

I don't know if this is the right place for my question, feel free to 
tell me if there is a better lsit for that topic.

I'm writing a Gtk2 app which has to launch external processes. To do 
that I use the Glib function "g_spawn_async".

My external is well launched but I wonder how I can be notified when it 
is finished. I was thinking about being aware of SIGCHILD but I don't 
know the best way to keep my code Gnome2 compliant.

If someone would tell me what is the best way to do that, it would be great.

You can add some watch, as:
g_io_add_watch (channel, G_IO_HUP, function, NULL);

Where function has the following prototype:

static gboolean
function (GIOChannel *channel, GIOCondition condition, gpointer data)
{
     ...
     if (condition & G_IO_HUP) {
        do_something;
     }

     return FALSE;
}

-- 
German Poo Caaman~o
mailto:gpoo ubiobio cl
http://www.ubiobio.cl/~gpoo/chilelindo.html
"Hay 10 tipos de personas: las que entienden binario y las que no."




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