I'm working on a desktop like interface using multiple radwindows on a single page. Right now I am trying to add functionality similar to the Windows 7 Show Desktop button that hides all open windows on click, and then restores all the windows on a second click. I have that funcionality working for the most part using minimizeAll() to hide everything and then a call to showAll(), to get the window titlebars back in place, and then a call to restoreAll() to get the windows back to their previous size.
The problem I am running into is that when a window is closed it is not truly destroyed. Therefore when I go to show my windows again the closed window comes back. I know I can switch the DestroyOnClose flag to true for the windows, which does solve this issue, but it breaks my event handlers for the close event on all other windows. When a window is created a set a handler for many events, close being one of them, like so:
This allows all windows to use my handler function which essentially takes the window information (title, url, x, y, width, height) and saves them for later use. That all works fine until I turn DestroyOnClose to true. Once that is done, only the first window closed executes the handler. Any window closed after that ignores the handler entirely as if the binding for that even was destroyed for all windows, not just the window being closed.
Is there something I can do to solve either one of these issues so that both pieces of the functionality work?
The problem I am running into is that when a window is closed it is not truly destroyed. Therefore when I go to show my windows again the closed window comes back. I know I can switch the DestroyOnClose flag to true for the windows, which does solve this issue, but it breaks my event handlers for the close event on all other windows. When a window is created a set a handler for many events, close being one of them, like so:
oWnd.add_close(
function
(sender, args) {
windowHandler(sender,
"close"
);
});
Is there something I can do to solve either one of these issues so that both pieces of the functionality work?