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:
is main above reasonable approach? or there better ways?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 ; }
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk How to wrap a GUI around a commandline program?
Ubuntu
Comments
Post a Comment