Setting the window title via a function