diff --git a/doc/xschem_man/commands.html b/doc/xschem_man/commands.html
index cc8b25d9..7eded0eb 100644
--- a/doc/xschem_man/commands.html
+++ b/doc/xschem_man/commands.html
@@ -163,6 +163,8 @@ shift 'N' Hierarchical netlist
- 'n' Netlist
ctrl 'n' New schematic
ctrl+shift 'N' New symbol
+alt 'n' Empty schematic in new window
+alt+shift 'N' Empty symbol in new window
shift 'O' Toggle Light / Dark colorscheme
ctrl 'o' Load schematic
alt 'p' Add symbol pin
diff --git a/src/actions.c b/src/actions.c
index c1c30950..a1cd3477 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -273,15 +273,20 @@ void new_window(const char *cell, int symbol)
} else if (!pid2) {
/* child of child */
if(!cell || !cell[0]) {
- execl(xschem_executable,xschem_executable,"-b", NULL);
+ if(!symbol)
+ execl(xschem_executable,xschem_executable,"-b", "--tcl",
+ "set netlist_type spice; set XSCHEM_START_WINDOW {}", NULL);
+ else
+ execl(xschem_executable,xschem_executable,"-b", "--tcl",
+ "set netlist_type symbol; set XSCHEM_START_WINDOW {}", NULL);
}
else if(!symbol) {
my_strncpy(f, cell, S(f));
- execl(xschem_executable,xschem_executable,"-b",f, NULL);
+ execl(xschem_executable,xschem_executable,"-b", "--tcl", "set netlist_type spice", f, NULL);
}
else {
my_strncpy(f, cell, S(f));
- execl(xschem_executable,xschem_executable,"-b",f, NULL);
+ execl(xschem_executable,xschem_executable,"-b", "--tcl", "set netlist_type symbol", f, NULL);
}
} else {
/* error */
diff --git a/src/callback.c b/src/callback.c
index d227c669..59bc9b3f 100644
--- a/src/callback.c
+++ b/src/callback.c
@@ -1223,6 +1223,16 @@ int callback(int event, int mx, int my, KeySym key,
copy_objects(START);
break;
}
+ if(key=='n' && state==Mod1Mask) /* Empty schematic in new window */
+ {
+ if(xctx->semaphore >= 2) break;
+ tcleval("xschem new_window");
+ }
+ if(key=='N' && state==(ShiftMask|Mod1Mask) ) /* Empty symbol in new window */
+ {
+ if(xctx->semaphore >= 2) break;
+ tcleval("xschem new_symbol_window");
+ }
if(key=='n' && state==ControlMask) /* New schematic */
{
if(xctx->semaphore >= 2) break;
diff --git a/src/keys.help b/src/keys.help
index 3594665c..fc6d440b 100644
--- a/src/keys.help
+++ b/src/keys.help
@@ -123,6 +123,8 @@ shift 'N' Hierarchical netlist
- 'n' Netlist
ctrl 'n' New schematic
ctrl+shift 'N' New symbol
+alt 'n' Empty schematic in new window
+alt+shift 'N' Empty symbol in new window
shift 'O' Toggle Light / Dark colorscheme
ctrl 'o' Load schematic
alt 'p' Add symbol pin
diff --git a/src/save.c b/src/save.c
index fc1cf6b4..5b307942 100644
--- a/src/save.c
+++ b/src/save.c
@@ -1089,8 +1089,13 @@ void load_schematic(int load_symbols, const char *filename, int reset_undo) /* 2
set_modify(0);
clear_drawing();
for(i=0;;i++) {
- if(i == 0) my_snprintf(name, S(name), "%s.sch", "untitled");
- else my_snprintf(name, S(name), "%s-%d.sch", "untitled", i);
+ if(netlist_type == CAD_SYMBOL_ATTRS) {
+ if(i == 0) my_snprintf(name, S(name), "%s.sym", "untitled");
+ else my_snprintf(name, S(name), "%s-%d.sym", "untitled", i);
+ } else {
+ if(i == 0) my_snprintf(name, S(name), "%s.sch", "untitled");
+ else my_snprintf(name, S(name), "%s-%d.sch", "untitled", i);
+ }
if(stat(name, &buf)) break;
}
my_snprintf(xctx->sch[xctx->currsch], S(xctx->sch[xctx->currsch]), "%s/%s", pwd_dir, name);
diff --git a/src/scheduler.c b/src/scheduler.c
index 8e0c523d..2b2a8854 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -1570,6 +1570,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
Tcl_ResetResult(interp);
}
+ else if(!strcmp(argv[1],"new_symbol_window"))
+ {
+ cmd_found = 1;
+ if(argc==2) new_window("",1);
+ else new_window(argv[2],1);
+ Tcl_ResetResult(interp);
+ }
+
else if(!strcmp(argv[1],"new_window"))
{
cmd_found = 1;
diff --git a/src/xschem.tcl b/src/xschem.tcl
index 46ebb86d..a23297f7 100644
--- a/src/xschem.tcl
+++ b/src/xschem.tcl
@@ -3846,6 +3846,14 @@ if { ( $::OS== "Windows" || [string length [lindex [array get env DISPLAY] 1] ]
xschem clear SYMBOL
}
toolbar_create FileNewSym {xschem clear SYMBOL} "New Symbol"
+ .menubar.file.menu add command -label "New empty Schematic window" -accelerator {Alt+N} \
+ -command {
+ xschem new_window
+ }
+ .menubar.file.menu add command -label "New empty Symbol window" -accelerator {Alt+Shift+N} \
+ -command {
+ xschem new_symbol_window
+ }
.menubar.file.menu add command -label "Open" -command "xschem load" -accelerator {Ctrl+O}
toolbar_create FileOpen "xschem load" "Open File"
.menubar.file.menu add command -label "Delete files" -command "xschem delete_files" -accelerator {Shift-D}