Application event handling example