From 4090011a645cb6fdc43fad3ddd003e033b466170 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Thu, 30 Nov 2023 20:52:28 +0100 Subject: [PATCH] avoid tk_messageBox in reload schematic warning message (blocks event loop). Avoid using xschem specific XSCHEM_SHAREDIR in utile/utile (can be used standalone) --- src/utile/utile | 13 +++++++++++-- src/xschem.tcl | 16 +++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/utile/utile b/src/utile/utile index 735b54e1..8bf055ca 100755 --- a/src/utile/utile +++ b/src/utile/utile @@ -3,6 +3,15 @@ # 10/01/2000 - all architecture-dependent paths ar set here after! # Schippers Stefan -export PATH="$XSCHEM_SHAREDIR/utile:$PATH" -export UTILE3_PATH="${XSCHEM_SHAREDIR}/utile" + + +UTILEDIR=$(dirname "$0") + +export PATH="$UTILEDIR:$PATH" +export UTILE3_PATH="${UTILEDIR}" + + + +# export PATH="$XSCHEM_SHAREDIR/utile:$PATH" +# export UTILE3_PATH="${XSCHEM_SHAREDIR}/utile" preprocess.awk $@ | expand_alias.awk | param.awk | clock.awk | stimuli.awk diff --git a/src/xschem.tcl b/src/xschem.tcl index 8a0447b6..e441d771 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -5038,7 +5038,7 @@ proc alert_ {txtlabel {position +200+300} {nowait {0}} {yesno 0}} { pack .alert.b1 -side left -fill x -expand yes if {$yesno} {pack .alert.b2 -side left -fill x -expand yes} tkwait visibility .alert - grab set .alert + # grab set .alert focus .alert.b1 bind .alert { destroy .alert } bind .alert { destroy .alert } @@ -6875,16 +6875,14 @@ proc build_widgets { {topwin {} } } { # toolbar_add FileMerge "xschem merge" "Merge File" $topwin $topwin.menubar.file.menu add command -label "Reload" -accelerator {Alt+S} \ -command { - if { [string compare [tk_messageBox -type okcancel -parent [xschem get topwindow] \ - -message {Are you sure you want to reload?}] ok]==0 } { - xschem reload - } + if {[alert_ "Are you sure you want to reload?" {} 0 1] == 1} { + xschem reload + } } toolbar_add FileReload { - if { [string compare [tk_messageBox -type okcancel -parent [xschem get topwindow] \ - -message {Are you sure you want to reload?}] ok]==0 } { - xschem reload - } + if {[alert_ "Are you sure you want to reload?" {} 0 1] == 1} { + xschem reload + } } "Reload File" $topwin $topwin.menubar.file.menu add command -label "Save as" -command "xschem saveas" -accelerator {Ctrl+Shift+S} $topwin.menubar.file.menu add command -label "Save as symbol" \