the thing is that you need to handle events with tgui via giving not a pointer, but an actual value, so you need to firstly dereference it gui.handleEvent(*event);
gui.handleEvent(*event);