a few quick changes to window.cpp...  But more changes need to be made.