Added center function to MyAppWindow class