now generate listeners for GUI