Improved usage example in main.cpp for events and handlers.