Make events for Okbutton and Cancelbutton pressses