Hi all,<br><br>I've recently checked out ways to have IDLE do something upon closing a window. Turns out the there is a beginning of such a mechanism in EditorWindow: the set_close_hook method. However, this method simply sets the instance's close_hook attribute, which means that setting it again will override the original hook. Specifically, EditorWindow sets the close_hook to
FileList.close_edit(self), which removes the window from the FileList. This means that overriding the close_hook could (and would) cause bugs (in FileList)!<br><br>The simplest solution AFAIK is to have a list of hooks and allow adding and removing hooks. Upon closing, the hooks are called in the reverse order of which they were added (
i.e. last added is called first).<br><br>Another solution would be to allow setting a new hook, and have a flag stating whether the old hook should be called after the new one is done.<br><br>Obviously more comprehensive solutions exist but I don't think we need something more complex.
<br><br>Thoughts? Ideas?<br><br>- Tal<br>