[Glade-users] newbie: making system calls from GUI

Joachim Backes Joachim Backes <backes@rhrk.uni-kl.de>
Thu, 06 Feb 2003 11:34:07 +0100 (CET)


On 06-Feb-2003 Manu C S wrote: 
>  Hi,
>  
>  I'm making a GUI for system commands.
>  For example, when a user clicks on a button, I want some system
>  command to be executed in the background and I want to trap the
>  output of the command and display it in my GUI.
>  
>  For example, if I want to launch a browser from my gui
>  when a user clicks on a certain button, should I have this in
>  the callback function of that button:
>      system("mozilla");
>  Is that correct?
>  How do I handle commands that write to stdout?

Use the "popen()" system call.

Regards

Joachim Backes

--

Joachim Backes <backes@rhrk.uni-kl.de>       | Univ. of Kaiserslautern
Computer Center, High Performance Computing  | Phone: +49-631-205-2438 
D-67653 Kaiserslautern, PO Box 3049, Germany | Fax:   +49-631-205-3056 
---------------------------------------------+------------------------
WWW: http://hlrwm.rhrk.uni-kl.de/home/staff/backes.html