gallery example: Implement File->Close functionality

This commit demonstrates a work around for issue #125.