Closed georgtree closed 2 months ago
I tested it with component browser, and it disappeared when I do Save As.
Yes I need to address this. The reason is simple. The preview_window() function (in xinit.c) saves as static (inside the function) data the informations about the previewed schematic. This means only one preview (including yours and the one used in the save/load file dialog) at a time may be active. Opening a second preview instance will overwrite the data of the previous preview and likely cause a lot of trouble.
Is it possible to return working state of preview window?
I solved this issue by recreate preview_window each time in event handler
This is a possibility, but I am working on a preview functions that allows multiple previews at the same time...
Sounds great :)
Ok, now preview_window should allow up to 10 open previews. You can do something like:
toplevel .a -bg {}
toplevel .b -bg {}
xschem preview_window create .a
xschem preview_window create .b
xschem preview_window draw .a xschem-repo/trunk/xschem_library/examples/poweramp.sch
xschem preview_window draw .b xschem-repo/trunk/xschem_library/examples/test_lm324.sch
You can repeat a xschem preview_window draw .a another_schematic
to update .a with a different schematic.
or you can do a
xschem preview_window destroy .a
...
...
toplevel .a -bg {}
xschem preview_window create .a
xschem preview_window draw .a yet_another_schematic
Yes, just tested, all work !
Hello! Could you help please - I have preview_window in detached window, all works, but after I make Save As action in main window, preview_window command stops work until I kill current window and launch tcl script again. I draw command in event handler, so after window stops work, event handler still work. What could be an issue? I add a video. Thank you in advance.
https://github.com/StefanSchippers/xschem/assets/113975847/f93b25d3-1f96-4ab6-887f-fceb99d72be6