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

system.verbs.builtins.Frontier.tools.windowTypes.callbacks.closeWindow

on closeWindow (adr) {
	<<Changes
		<<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 Frontier.tools.windowTypes.commands.close 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 Frontier.tools.windowTypes.findWindowType (windowType, @adrWindowType, adr) {
			local (adrscript = @adrWindowType^.closeWindow);
			if defined (adrscript^) {
				if not adrscript^ (adr) {
					return (false)}};
			if not Frontier.tools.windowTypes.commands.close (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.