< index < 2. Console < 2.1 Initializing the console | ===================================== 2.1.6 Handling "close window" events ===================================== |

    C++ : static bool TCODConsole::isWindowClosed()
    C   : bool TCOD_console_is_window_closed()
    Py  : console_is_window_closed()

When you start the program, this returns false. Once a "close window" event has been sent by the window manager, it will allways return true. You're supposed to exit cleanly the game.