newFile function in main window