Adding initially visible flag to window creation and explicit hide/show functions