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. C code:
  5. #include <tcl.h>
  6. int main( int argc, char * argv[] ) {
  7. int return_value ;
  8. Tcl_FindExecutable(NULL) ;
  9. //Tcl_FindExecutable(argv[0]) ;
  10. Tcl_Interp * interp ;
  11. interp = Tcl_CreateInterp() ;
  12. Tcl_Init(interp) ;
  13. return_value = Tcl_EvalFile( interp, "req_tk.tcl") ;
  14. if(return_value != TCL_OK) {
  15. // return Tcl_ERROR ;
  16. printf("errrror\n") ;
  17. }
  18. else
  19. {
  20. printf("all is good no error\n") ;
  21. ;
  22. }
  23. Tcl_Exit(0);
  24. return 0 ;
  25. }

AltStyle によって変換されたページ (->オリジナル) /