fix View->Toggle variable line width menu command not working, add "xschem set line_width n", equivalent to "xschem line_width n", these commands now update the tcl var line_width.

This commit is contained in:
stefan schippers 2026-04-22 15:48:58 +02:00
parent a547cf4e75
commit 0a1512201f
3 changed files with 19 additions and 5 deletions

View File

@ -1522,7 +1522,8 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
<li><kbd> hide_symbols </kbd> set to 0,1,2 for various hiding level of symbols </li>
<li><kbd> hilight_color </kbd> set hilight color for next hilight </li>
<li><kbd> infowindow_text </kbd> ERC messages </li>
<li><kbd> intuitive_interface </kbd> ERC messages </li>
<li><kbd> intuitive_interface </kbd> set intuitive interface </li>
<li><kbd> line_width </kbd> set line width </li>
<li><kbd> netlist_name </kbd> set custom netlist name </li>
<li><kbd> netlist_type </kbd> set netlisting mode (spice, verilog, vhdl, tedax, symbol) </li>
<li><kbd> no_draw </kbd> set no drawing flag (0 or 1) </li>

View File

@ -2991,8 +2991,12 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
* set line width to floating point number 'n' */
else if(!strcmp(argv[1], "line_width"))
{
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
if(argc > 2) {
change_linewidth(atof(argv[2]));
double w;
w = atof(argv[2]);
change_linewidth(w);
tclsetdoublevar("line_width", w);
Tcl_ResetResult(interp);
}
}
@ -5475,6 +5479,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
else if(!strcmp(argv[2], "change_lw")) { /* allow change line width when zooming */
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
xctx->change_lw = atoi(argv[3]);
dbg(1, "xschem change_lw: change_lw = %d\n", xctx->change_lw);
tclsetboolvar("change_lw", xctx->change_lw);
}
else if(!strcmp(argv[2], "color_ps")) { /* set color psoscript (1 or 0) */
@ -5555,11 +5560,19 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
my_strdup(_ALLOC_ID_, &xctx->infowindow_text, argv[3]);
}
else if(!strcmp(argv[2], "intuitive_interface")) { /* ERC messages */
else if(!strcmp(argv[2], "intuitive_interface")) { /* set intuitive interface */
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
xctx->intuitive_interface = atoi(argv[3]);
}
else if(!strcmp(argv[2], "line_width")) /* set line width */
{
double w;
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
w = atof(argv[3]);
change_linewidth(w);
tclsetdoublevar("line_width", w);
Tcl_ResetResult(interp);
}
} else { /* argv[2][0] >= 'n' */
if(!strcmp(argv[2], "netlist_name")) { /* set custom netlist name */
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}

View File

@ -10503,7 +10503,7 @@ proc build_widgets { {topwin {} } } {
}
$topwin.menubar.view add checkbutton -label "Toggle variable line width" -variable change_lw \
-selectcolor $selectcolor -accelerator {_} -command "xschem set change_lw $change_lw"
-selectcolor $selectcolor -accelerator {_} -command {xschem set change_lw $change_lw}
$topwin.menubar.view add command -label "Set line width" -accelerator {Alt+-} \
-command {
input_line "Enter linewidth (float):" "xschem line_width"