proc set_tab_names: call [xschem get schname] only once

This commit is contained in:
stefan schippers 2024-12-16 01:24:36 +01:00
parent 8fef4f0d95
commit cac5392a45
2 changed files with 5 additions and 4 deletions

View File

@ -826,7 +826,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
/* destroy_all [force]
* Close all additional windows/.tabs. If 'force' is given do not ask for
* Close all additional windows/tabs. If 'force' is given do not ask for
* confirmation for changed schematics
* Returns the remaining # of windows/tabs in addition to main window/tab */
else if(!strcmp(argv[1], "destroy_all"))
@ -1556,7 +1556,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
else x = xctx->currsch;
if(x < 0 ) x = xctx->currsch + x;
if(x<=xctx->currsch && x >= 0) {
Tcl_SetResult(interp, xctx->sch[x], TCL_VOLATILE);
Tcl_SetResult(interp, xctx->sch[x], TCL_VOLATILE); /* if xctx->sch[x]==NULL return empty string */
}
}
else if(!strcmp(argv[2], "schprop")) /* get schematic "spice" global attributes */

View File

@ -6982,10 +6982,11 @@ proc set_tab_names {{mod {}}} {
if {[info exists has_x] && $tabbed_interface } {
set currwin [xschem get current_win_path]
set currsch [xschem get schname]
regsub {\.drw} $currwin {} tabname
if {$tabname eq {}} { set tabname .x0}
.tabs$tabname configure -text [file tail [xschem get schname]]$mod -background $tab_color
balloon .tabs$tabname [xschem get schname]
.tabs$tabname configure -text [file tail $currsch]$mod -background $tab_color
balloon .tabs$tabname $currsch
for { set i 0} { $i < $tctx::max_new_windows} { incr i} {
if { [winfo exists .tabs.x$i] && ($tabname ne ".x$i")} {
.tabs.x$i configure -background $tctx::tab_bg