From 3d7f8dff82a01c941b59b8e9f7956728ecd3aae1 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Thu, 7 Mar 2024 01:05:23 +0100 Subject: [PATCH] initialize file_dialog_retval to empty when clicking one of the recently used symbols in the `Recent` toolbox to avoid an abort operation on the very first time when leaving the file browser dialog (bind .load event) --- src/xschem.tcl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/xschem.tcl b/src/xschem.tcl index 7cd90334..0c4a88bb 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -3377,7 +3377,11 @@ proc add {f} { set ret 1 set i [expr { ($c_t(top)-1) % $c_t(n) } ];# last element set c_t($i,file) $f - set c_t($i,command) "xschem abort_operation; file_dialog_display_preview {$f}; xschem place_symbol {$f} " + set c_t($i,command) " + set file_dialog_retval {} + xschem abort_operation + file_dialog_display_preview {$f} + xschem place_symbol {$f} " set c_t($i,text) [file tail [file rootname $f]] set c_t(top) $i if {$ret} {write_recent_file} @@ -3589,10 +3593,10 @@ proc file_dialog_place_symbol {} { global file_dialog_retval set entry [.load.buttons_bot.entry get] - # puts "entry=$entry, file_dialog_retval=$file_dialog_retval" + # puts "entry=$entry" set file_dialog_retval $entry set sym [file_dialog_getresult 2 0] - # puts "sym=$sym file_dialog_dir1=$file_dialog_dir1 file_dialog_dir2=$file_dialog_dir2" + # puts "sym=$sym" xschem abort_operation if {$sym ne {}} { xschem place_symbol "$sym"