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

  1. package require Tk
  2. button .b -text {Push Me} -command {tk_messageBox -message {hello, world}}
  3. pack .b
  4.  
  5. C code:
  6.  
  7. #include <tcl.h>
  8.  
  9. int main( int argc, char * argv[] ) {
  10. int return_value ;
  11. Tcl_FindExecutable(NULL) ;
  12. //Tcl_FindExecutable(argv[0]) ;
  13. Tcl_Interp * interp ;
  14. interp = Tcl_CreateInterp() ;
  15. Tcl_Init(interp) ;
  16. return_value = Tcl_EvalFile( interp, "req_tk.tcl") ;
  17.  
  18. if(return_value != TCL_OK) {
  19. // return Tcl_ERROR ;
  20. printf("errrror\n") ;
  21. }
  22. else
  23. {
  24. printf("all is good no error\n") ;
  25. ;
  26. }
  27.  
  28. Tcl_Exit(0);
  29. return 0 ;
  30. }