On Thu, 19 Nov 2009 22:11:18 +0100 "Till Harbaum / Lists" <li...@harbaum.org> wrote: > Hi, > > i am trying to run a text mode application in the background of my > gtk one and display its output in a textview. I know this is supposed > to be done using g_spawn_async_with_pipes and then link to the output > via g_io_add_watch. I even got something that sort of works, but the > output is very much delayed and comes in chunks and worse, the CPU > load is at max while and after i run my code. > > Are there any examples for doing this? There must be many programs > doing something similar to run e.g. some little helper program or > similar.
You generally won't get away with forking after the gtk+ main loop is running. You should fork before the main loop is running, and if you cannot do that start a new thread to fork from. If you do the latter on a POSIX (unix-like) system you must only call async-signal-safe functions between the fork and the exec*. If you are using windows, I do not know what the restraints are. Chris _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list