where to use g_spawn_async

Hello list,
in order to redirect the output of an external process to my gtkTextView I
used the g_spawn_async function in a callback function. Is that correct? If
that, why the window wait for the complete execution of the spawned process?
I use:
  if( g_spawn_async_with_pipes("./", // gchar *working_directory
          NULL, //gchar **envp,
          G_SPAWN_SEARCH_PATH, //GSpawnFlags flags,
          NULL, //GSpawnChildSetupFunc child_setup,
          NULL, //gpointer user_data,
          NULL, //GPid *child_pid,
          &std_in, // gint *standard_input,
          &std_out, //gint *standard_output,
          &std_err, //gint *standard_error,
          NULL //GError **error
          )       ) {
      GIOChannel* output = g_io_channel_unix_new(std_out);
      g_io_channel_read_chars (output, // GIOChannel *channel
          buf,    // gchar *buf
          -1,    // gsize count
          NULL,   // gsize *bytes_read,
          NULL    //GError **error
Please help me!!!!

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