|
From: Jun T. <tak...@kb...> - 2015-08-25 14:35:14
|
2015/08/25 12:43, Allin Cottrell <cot...@wf...> wrote: > But if I do the same thing programmatically (using the GLib function > g_spawn_async) the wxt window appears momentarily, with the plot > looking OK so far as I can tell, then disappears right away. The > GLib call seems to be correct; it works as intended on Linux. > Somehow on OS X the "pause mouse close" isn't preventing the > termination of the gnuplot process. I have no experience with glib, but I guess the stdin of the spawned gnuplot is set to /dev/null, so the gnuplot thinks it should quit (as if you typed ctrl-D in the terminal = EOF). On Linux, wxt window is managed by a separate process from the main gnuplot process. But on Mac, gnuplot+wxt is a single process, and if the main gnuplot quits then the plot window will go away. You may try setting the G_SPAWN_CHILD_INHERITS_STDIN bit in the 'flags' (the 4th arg of g_spawn_async()), so that the gnuplot will inherit the stdin from the parent. Jun |