From aa95f0ff9d1c9ab7d65a0c7322ad1ceec43c6df0 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Tue, 12 Nov 2024 01:16:43 +0100 Subject: [PATCH] Small changes to allow build with tcl-tk 9.0 --- scconfig/src/scripts/find_tcl.c | 7 ++++++- src/xschem.tcl | 14 +++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/scconfig/src/scripts/find_tcl.c b/scconfig/src/scripts/find_tcl.c index 9ea10cca..d39f4f82 100644 --- a/scconfig/src/scripts/find_tcl.c +++ b/scconfig/src/scripts/find_tcl.c @@ -23,7 +23,7 @@ #include "scripts.h" #include -static int all_vers[] = { 86, 85, 84, 0, -1 }; +static int all_vers[] = { 90, 86, 85, 84, 0, -1 }; int find_script_tcl_(const char *name, int logdepth, int fatal, int *vers, int fallback) { @@ -32,9 +32,11 @@ int find_script_tcl_(const char *name, int logdepth, int fatal, int *vers, int f char *tclshs[] = { "tclsh", + "tclsh90", "tclsh86", "tclsh85", "tclsh84", + "tclsh9.0", "tclsh8.6", "tclsh8.5", "tclsh8.4", @@ -280,6 +282,9 @@ int find_script_tk(const char *name, int logdepth, int fatal) sprintf(lfl, "-ltk%d.%d", major, minor); if (try_icl_tk(logdepth, "libs/script/tk", test_c, NULL, NULL, lfl, *v)) return 0; + + sprintf(lfl, "-ltcl%dtk%d.%d", major, major, minor); + if (try_icl_tk(logdepth, "libs/script/tk", test_c, NULL, NULL, lfl, *v)) return 0; } return try_fail(logdepth, "libs/script/tk"); diff --git a/src/xschem.tcl b/src/xschem.tcl index f1fe9ea0..4aa10927 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -3383,7 +3383,7 @@ namespace eval c_toolbar { variable c_t variable i set c_t(w) .load.l.recent - set c_t(hash) [xschem hash_string $XSCHEM_LIBRARY_PATH] + set c_t(hash) [xschem hash_string $::XSCHEM_LIBRARY_PATH] set c_t(n) 25 set c_t(top) 0 for {set i 0} {$i < $c_t(n)} {incr i} { @@ -7217,6 +7217,18 @@ global env has_x OS autofocus_mainwindow # $topwin configure -cursor {} " bind $topwin "xschem callback %W %T %x %y 0 %w %h %s" + + # transform mousewheel events into button4/5 events + if {[info tclversion] > 8.7} { + bind $topwin { + if {%D > 0} { + xschem callback %W 4 %x %y 0 4 0 %s + } else { + xschem callback %W 4 %x %y 0 5 0 %s + } + } + } + bind $topwin "xschem callback %W -3 %x %y 0 %b 0 %s" bind $topwin "xschem callback %W -3 %x %y 0 %b 0 %s" bind $topwin "xschem callback %W -3 %x %y 0 %b 0 %s"