load_file("nrngui.hoc")

strdef tstr

xpanel("Figures for Wang XJ et al 1991")
xlabel("Press a button to create the figure")
xradiobutton("3", "restart(\"fig3\")")
xlabel("This panel provided for possible future expansion of demo.")
xpanel(5,100)

pwmcnt = PWManager[0].count // the initial gui should not be dismissed

proc restart() {local i
	objref graphItem, save_window_
	for i=0, n_graph_lists-1 {
		graphList[i].remove_all()
	}
	flush_list.remove_all()
	fast_flush_list.remove_all()
	doNotify()
	for (i= PWManager[0].count-1; i >= pwmcnt; i -= 1) {
		PWManager[0].close(i)
		doNotify()
	}
	
	sprint(tstr, "%s.hoc", $s1)
	load_file(1, tstr)
}