save / restore tcl context when creating / destroying preview window
This commit is contained in:
parent
b8fecf997b
commit
8269eff430
|
|
@ -1172,6 +1172,7 @@ void preview_window(const char *what, const char *win_path, const char *fname)
|
|||
}
|
||||
else if(!strcmp(what, "draw")) {
|
||||
dbg(1, "preview_window() draw\n");
|
||||
tclvareval("save_ctx ", xctx->current_win_path, NULL);
|
||||
save_xctx = xctx; /* save current schematic */
|
||||
xctx = preview_xctx;
|
||||
if(!current_file || strcmp(fname, current_file) ) {
|
||||
|
|
@ -1206,6 +1207,7 @@ void preview_window(const char *what, const char *win_path, const char *fname)
|
|||
Tk_DestroyWindow(tkpre_window);
|
||||
my_free(_ALLOC_ID_, ¤t_file);
|
||||
xctx = save_xctx; /* restore schematic */
|
||||
tclvareval("restore_ctx ", xctx->current_win_path, NULL);
|
||||
save_xctx = NULL;
|
||||
set_modify(-1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue