replace sleep with event_loop checking for expose
destroy icon when tray destroyed, start over