at creation or before opening a window