Skip to main content

Thread: How to wrap a GUI around a commandline program?


the commandline program ccc accepts commands stdin , generates results on stdout. source code not available ccc, binary.

gui program ggg uses stdin , stdout input , output communication ccc. ggg stdin connects output of ccc , ggg stdout connects ccc stdin pipes. ggg starts ccc. source has written ggg.

ggg catches gui events translated to ccc input commands sent on ggg stdout , ggg stdin data goes gui widgets.

not sure how make 'crossed-cable' type of connection between ggg , ccc.

here incomplete starter main ggg:

code:
int main ( int argc , char * argv[] )    {    pid = fork ( ) ;    if ( pid == 0 ) // child process       {       execl ( "ccc" , ... ) ; // starts process comandline ccc       }    else if ( pid != -1 )  // gui process       {       init_gui() ;       // goes in here crossed-cable stuff?       }    return 0 ;    }
is main above reasonable approach? or there better ways?



Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk How to wrap a GUI around a commandline program?


Ubuntu

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???