w.setAspectRatio(16, 9); // Window now always 16:9 w.setAspectRatio(4, 3); // Window is 4:3
See Implementation