sourcing of user specified tcl scripts in xschemrc done after all graphics setup complete so we can autoload multiple tabs on startup, among other funny things

This commit is contained in:
Stefan Frederik 2022-01-13 02:08:36 +01:00
parent 54f3211d51
commit c3ad08fdd4
4 changed files with 15 additions and 11 deletions

View File

@ -1457,6 +1457,8 @@ void zoom_full(int dr, int sel, int flags, double shrink)
xctx->areah = xctx->areay2 - xctx->areay1;
}
calc_drawing_bbox(&boundbox, sel);
dbg(1, "zoom_full: %s, %g %g %g %g\n",
xctx->current_win_path, boundbox.x1, boundbox.y1, boundbox.x2, boundbox.y2);
schw = xctx->areaw-4*INT_WIDTH(xctx->lw);
schh = xctx->areah-4*INT_WIDTH(xctx->lw);
bboxw = boundbox.x2-boundbox.x1;

View File

@ -2316,6 +2316,11 @@ int Tcl_AppInit(Tcl_Interp *inter)
tcleval( "waves [file tail \"[xschem get schname]\"]");
}
/* */
/* SOURCE XSCHEMRC SUPPLIED TCL FILES */
/* */
tcleval("update; source_user_tcl_files");
/* source tcl file given on command line with --script */
if(tcl_script[0]) {
char str[PATH_MAX + 40];
@ -2324,7 +2329,7 @@ int Tcl_AppInit(Tcl_Interp *inter)
* its dynamically allocated string
*/
my_snprintf(str, S(str), "update; source {%s}", tcl_script);
Tcl_EvalEx(interp, str, -1, TCL_EVAL_GLOBAL);
tcleval(str);
}
if(quit) {

View File

@ -4750,7 +4750,7 @@ proc set_replace_key_binding {} {
proc source_user_tcl_files {} {
global tcl_files
foreach i $tcl_files {
source $i
uplevel #0 "source $i"
}
}
@ -5060,9 +5060,6 @@ regsub -all {#} $svg_colors {0x} svg_colors
if { $show_infowindow } { wm deiconify .infotext }
# source all files listed in 'tcl_files' variable
source_user_tcl_files
# xschem listen and bespice listen
setup_tcp_xschem
setup_tcp_bespice

View File

@ -22,24 +22,24 @@ B 2 260 -1080 720 -920 {flags=1
y1 = 0
y2 = 0.93
divy = 5
x1=1.23616e-07
x2=4.51672e-07
x1=7.96491e-08
x2=4.07704e-07
divx=5
subdivx=4
unitx=n
node="v(cal) v(saout)"
node="cal saout"
color="4 5"
}
B 2 260 -1220 720 -1090 {flags=1
y1 = 0.647719
y2 = 0.652802
divy = 5
x1=1.23616e-07
x2=4.51672e-07
x1=7.96491e-08
x2=4.07704e-07
unitx=n
divx=5
subdivx=4
node="v(plus) v(minus)"
node="plus minus"
color="4 5"}
T {CAL} 140 -180 0 1 0.4 0.4 {}
T {EN} 140 -130 0 1 0.4 0.4 {}