1. Install the manpages-dev package.
2. Pull up the man page for "fork", that will show you how to start anther process. Also look at the "exec" man pages ("execv" is one).
Here is roughly what you'd write if you wanted to run "/home/user/bin/burnit" with the argument "pics":
Code:
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
on_button1_clicked (GtkButton *button,
gpointer user_data)
{
int status;
if (fork() == 0) {
execl("/home/user/bin/burnit", "pics");
}
wait(&status);
}
The control will return to the GUI after the script has been run.
Bookmarks