preview_window: check xctx valid before calling resetwin()
This commit is contained in:
parent
834d2c9757
commit
035794df47
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -8582,6 +8582,19 @@ global env has_x OS autofocus_mainwindow
|
|||
bind $topwin <ButtonPress> "xschem callback %W %T %x %y 0 %b 0 %s"
|
||||
}
|
||||
bind $topwin <ButtonRelease> "xschem callback %W %T %x %y 0 %b 0 %s"
|
||||
|
||||
#### test: show keybindings
|
||||
# bind $topwin <KeyPress-slash> "
|
||||
# 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 <KeyPress> "
|
||||
if {{%K} eq {Escape}} { destroy .ctxmenu }
|
||||
xschem callback %W %T %x %y %N 0 0 %s"
|
||||
|
|
|
|||
Loading…
Reference in New Issue