example GUI with event handling