Posted to tcl by HalfMadDad at Mon Feb 03 17:17:56 GMT 2020view pretty

package require Tk
button .b -text {Push Me} -command {tk_messageBox -message {hello, world}}
pack .b

C code:

#include <tcl.h>

int main( int argc, char * argv[] ) {
  int return_value ;
  Tcl_FindExecutable(NULL) ;
  //Tcl_FindExecutable(argv[0]) ;
  Tcl_Interp * interp ;
  interp = Tcl_CreateInterp() ;
  Tcl_Init(interp) ;
  return_value =  Tcl_EvalFile( interp,  "req_tk.tcl") ;

  if(return_value != TCL_OK) {
 // return Tcl_ERROR ;
  printf("errrror\n") ; 
  }
   else 
       {
   printf("all is good no error\n") ;   
  ;
  } 

  Tcl_Exit(0);
 return 0 ;
}