From 059ac92695e9a51f61838a78629b6b57011ef2d5 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Tue, 19 Aug 2025 09:00:09 +0200 Subject: [PATCH] fix catch command in tclvareval(....menubar entryconfigure ...) commands --- src/actions.c | 10 +++++----- src/callback.c | 4 ++-- src/save.c | 8 ++++---- src/scheduler.c | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/actions.c b/src/actions.c index bfc02b36..74ebf4c3 100644 --- a/src/actions.c +++ b/src/actions.c @@ -164,26 +164,26 @@ int set_modify(int mod) /* Do not configure buttons if displaying in preview window */ if(has_x && (xctx->top_path[0] == '\0' || strstr(xctx->top_path, ".x") == xctx->top_path)) { char s[256]; - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Netlist -background $simulate_bg}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Netlist -background $simulate_bg}", NULL); tclvareval("set tctx::", xctx->current_win_path, "_netlist $simulate_bg", NULL); my_snprintf(s, S(s), "tctx::%s_simulate_id", xctx->current_win_path); if(tclgetvar(s)) { - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Simulate -background}", tclresult(), NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Simulate -background}", tclresult(), NULL); tclvareval("set tctx::", xctx->current_win_path, "_simulate ", tclresult(), NULL); } else { - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Simulate -background $simulate_bg}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Simulate -background $simulate_bg}", NULL); tclvareval("set tctx::", xctx->current_win_path, "_simulate $simulate_bg", NULL); } } if(sch_waves_loaded() >= 0) { if(has_x && (xctx->top_path[0] == '\0' || strstr(xctx->top_path, ".x") == xctx->top_path)) { tclvareval("set tctx::", xctx->current_win_path, "_waves Green", NULL); - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Waves -background Green}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Waves -background Green}", NULL); } } else { if(has_x && (xctx->top_path[0] == '\0' || strstr(xctx->top_path, ".x") == xctx->top_path)) { tclvareval("set tctx::", xctx->current_win_path, "_waves $simulate_bg", NULL); - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Waves -background $simulate_bg}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Waves -background $simulate_bg}", NULL); } } } diff --git a/src/callback.c b/src/callback.c index 1e85e1b9..6f8abe39 100644 --- a/src/callback.c +++ b/src/callback.c @@ -3163,12 +3163,12 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m } if(err) { if(has_x) { - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Netlist -background red}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Netlist -background red}", NULL); tclvareval("set tctx::", xctx->current_win_path, "_netlist red", NULL); } } else { if(has_x) { - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Netlist -background Green}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Netlist -background Green}", NULL); tclvareval("set tctx::", xctx->current_win_path, "_netlist Green", NULL); } } diff --git a/src/save.c b/src/save.c index 87d67005..e972b7a6 100644 --- a/src/save.c +++ b/src/save.c @@ -890,7 +890,7 @@ void free_rawfile(Raw **rawptr, int dr, int no_warning) if(has_x) { tclvareval("set tctx::", xctx->current_win_path, "_waves $simulate_bg", NULL); - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Waves -background $simulate_bg}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Waves -background $simulate_bg}", NULL); } if(dr) draw(); @@ -1060,10 +1060,10 @@ int raw_read(const char *f, Raw **rawptr, const char *type, int no_warning, doub if(has_x) { if(sch_waves_loaded() >= 0) { tclvareval("set tctx::", xctx->current_win_path, "_waves Green", NULL); - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Waves -background Green}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Waves -background Green}", NULL); } else { tclvareval("set tctx::", xctx->current_win_path, "_waves $simulate_bg", NULL); - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Waves -background $simulate_bg}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Waves -background $simulate_bg}", NULL); } } return res; @@ -3453,7 +3453,7 @@ int save_schematic(const char *schname, int fast) /* 20171020 added return value if(fast) set_modify(2); /* only clear modified flag, no title/tab/sim buttons update */ else set_modify(0); } - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Simulate -background $simulate_bg}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Simulate -background $simulate_bg}", NULL); tclvareval("set tctx::", xctx->current_win_path, "_simulate $simulate_bg", NULL); tclvareval("catch {unset tctx::", xctx->current_win_path, "_simulate_id}", NULL); /* set local simulation directory if local_netlist_dir is set*/ diff --git a/src/scheduler.c b/src/scheduler.c index 4c2b252d..2aa07e29 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -3506,12 +3506,12 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } if(err) { if(has_x) { - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Netlist -background red}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Netlist -background red}", NULL); tclvareval("set tctx::", xctx->current_win_path, "_netlist red", NULL); } } else { if(has_x) { - tclvareval(xctx->top_path, "catch {.menubar entryconfigure Netlist -background Green}", NULL); + tclvareval("catch {", xctx->top_path, ".menubar entryconfigure Netlist -background Green}", NULL); tclvareval("set tctx::", xctx->current_win_path, "_netlist Green", NULL); } }