Use event interface for GUI (fixes #383)