Window: new class
Window: added write and flush methods