Re: Running Gtk application in new terminal



Yes, except he said that his main program *isn't* using GTK+. Now he could *convert* his main program to use glib and friends, but that's probably going to be a bigger task. Worth it maybe for a major project with cross-platform aspirations, but probably not for a homework assignment in first-year CS. We really don't have much context here for why he wants it, what his abilities are, who his target users are, ...

-- Alan


On 6/5/2014 9:59 AM, Chris Vine wrote:
On Thu, 5 Jun 2014 16:08:07 +0000
"Mazer, Alan S (389M)" <Alan S Mazer jpl nasa gov> wrote:
Here you go.  This code implements a simple command processor, one
command of which starts up a gtk app.  I tried it with an app of mine
called "ngdcs" and it works.  You might want to read up on fork and
exec ("man fork", "man execv") but this does work for me:
Since the OP is using GTK+, it seems more logical to use
g_spawn_async() or g_spawn_async_with_pipes(), the latter of which will
also set up pipes for stdin, stdout and stderr for you.  (And they are
also cross-platform.)

https://developer.gnome.org/glib/2.40/glib-Spawning-Processes.html

Chris



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