PDA

View Full Version : new terminal from gtk+ program



Ulrik04
September 25th, 2008, 07:43 PM
hello :)

I'm making a program in c++/gtk+, and I have to tun another terminal c++ program from it. I've tried system("./program"); but that just shows the program in the terminal the gtk program was run from, and if I doesn't run the gtk program from a terminal, nothing will happen. (did that make sense? :/)
my question is just: how do i open a terminal window, that is executing a file, from a c++ program?

Zugzwang
September 26th, 2008, 01:05 PM
You can try system("xterm -e \"./program\"") or something like that. I'm afraid that you will have to explicitly specify a terminal program.

Alternative, you can get the output of the called program using popen() and display them somewhere in your application.

Ulrik04
September 26th, 2008, 01:49 PM
thanks that worked ok :D