Keeping the example simple...

...don't make it full window and remove the resize handling.