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


on restoreWindowState (adr, adrInfo) {
	<<Restore the state of a window, its position, size, scroll state, and expansion state.
		<<05/02/00; 6:06:35 PM by PBS
		<<12/05/00; 11:35:27 PM by JES
			<<If adrInfo^ is not a tableType object, create a windowInfoTable based on the outline window.
	local (oldTarget = target.set (adr));
	if typeOf (adrInfo^) != tableType { //12/05/00 JES
		new (tableType, adrInfo);
		window.getPosition (adr, @adrInfo^.["left"], @adrInfo^.top);
		window.getSize (adr, @adrInfo^.width, @adrInfo^.height);
		return (true)};
	if adrInfo^.expansionState == {} {
		op.fullCollapse ()}
	else {
		op.setExpansionState (adrInfo^.expansionState)};
	op.setScrollState (adrInfo^.scrollLine);
	window.setPosition (adr, adrInfo^.["left"], adrInfo^.top);
	window.setSize (adr, adrInfo^.height, adrInfo^.width);
	try {target.set (oldTarget)};
	return (true)}

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.