separate TCOD library loading from root console
support close window event