add an event to a button