load_file("nrngui.hoc")

strdef tstr

xpanel("Figures for Destexhe, Mainen, and Sejnowski Neural Comp. 6:14-18, 1994")

xlabel("Figures for Destexhe, Mainen, and Sejnowski")
xlabel("Neural Computation 6:14-18, 1994")
xradiobutton("fig 1 A", "restart(\"demo_glutamate_neuralcomputation\")")
xradiobutton("fig 1 D", "restart(\"demo_gaba_neuralcomputation\")")
xpanel(5,100)

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

proc restart() {local i
	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.oc", $s1)
	load_file(1, tstr)
	init()
	run()
}