This sentence isn't clear to me - "To close the window programatically give the window a ref and use the closeWindow function." can you share a simple example or usage? or refer to an example in the docs?