diff --git a/src/xinit.c b/src/xinit.c index 96500823..7cdf1b3f 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -1267,7 +1267,7 @@ int preview_window(const char *what, const char *win_path, const char *fname) dbg(1, "preview_window() draw, load schematic\n"); load_schematic(1,fname, 0, 1); } else { - resetwin(1, 1, 0, 0, 0); /* resetwin(create_pixmap, clear_pixmap, force) */ + if(xctx) resetwin(1, 1, 0, 0, 0); /* resetwin(create_pixmap, clear_pixmap, force) */ } zoom_full(1, 0, 1 + 2 * tclgetboolvar("zoom_full_center"), 0.97); /* draw */ xctx = save_xctx; diff --git a/src/xschem.tcl b/src/xschem.tcl index 1d141370..ab490100 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -8582,6 +8582,19 @@ global env has_x OS autofocus_mainwindow bind $topwin "xschem callback %W %T %x %y 0 %b 0 %s" } bind $topwin "xschem callback %W %T %x %y 0 %b 0 %s" + + #### test: show keybindings + # bind $topwin " + # if {!\[info exists bindkeys\]} { + # set bindkeys 1 + # xschem preview_window create $topwin + # xschem preview_window draw $topwin [abs_sym_path bindkeys_cheatsheet.sym] + # } else { + # unset bindkeys + # xschem preview_window $topwin close + # xschem redraw + # } + # " bind $topwin " if {{%K} eq {Escape}} { destroy .ctxmenu } xschem callback %W %T %x %y %N 0 0 %s"