launcher(): bring up an alert dialog if tclcommand did not execute successfully

This commit is contained in:
stefan schippers 2024-04-25 12:10:56 +02:00
parent 13a7e9ebcc
commit 9631cd2bcf
1 changed files with 5 additions and 1 deletions

View File

@ -1747,7 +1747,11 @@ void launcher(void)
} else {
my_strncpy(program, get_tok_value(prop_ptr,"tclcommand",0), S(program));
if(program[0]) { /* execute tcl command */
tcleval(program);
if(Tcl_GlobalEval(interp, program) != TCL_OK) {
dbg(0, "%s\n", tclresult());
if(has_x) tclvareval("alert_ {", tclresult(), "} {}", NULL);
Tcl_ResetResult(interp);
}
}
}
tcleval("after 300");