Monday, November 08, 2010 at 12:03 AM.

on closeWindow (adr) {
		<<11/28/01; 2:47:30 PM by JES
			<<Work around a crashing kernel bug.
		<<11/28/01; 1:32:39 PM by JES
			<<If returns false, i.e. the user clicked the Cancel button in a save confirmation dialog, don't allow the window to close.
	if not defined (adr^) { //not an addressible window -- fixes a freeze on the close box, for the Find & Replace dialog
		return (true)}; //allow the rest of the closeWindow callbacks to run, or allow the window to close if no more callbacks
	local (windowType);
	if window.attributes.getOne ("type", @windowType, adr) {
		local (adrWindowType);
		if (windowType, @adrWindowType, adr) {
			local (adrscript = @adrWindowType^.closeWindow);
			if defined (adrscript^) {
				if not adrscript^ (adr) {
					return (false)}};
			if not (adr) {
				return (false)}; //the user clicked Cancel in the close confirmation dialog
			if not defined (adr^) { //the window has been deleted -- don't allow the kernel to try to close it.
				return (false)}}};
	return (true)}; //default behavior

<<bundle //debugging
	<<closeWindow (window.frontMost ())

This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.