def METHOD_NAME(self, event: pygame.event.Event) -> bool:
    """
    Process any events relevant to the confirmation dialog.
    We close the window when the cancel button is pressed, and post a confirmation event
    (UI_CONFIRMATION_DIALOG_CONFIRMED) when the OK button is pressed, and also close the window.
    :param event: a pygame.Event.
    :return: Return True if we 'consumed' this event and don't want to pass it on to the rest
             of the UI.
    """
    consumed_event = super().METHOD_NAME(event)
    if event.type == UI_BUTTON_PRESSED and event.ui_element == self.cancel_button:
        self.kill()
    if event.type == UI_BUTTON_PRESSED and event.ui_element == self.confirm_button:
        # old event - to be removed in 0.8.0
        event_data = {'user_type': OldType(UI_CONFIRMATION_DIALOG_CONFIRMED),
                      'ui_element': self,
                      'ui_object_id': self.most_specific_combined_id}
        pygame.event.post(pygame.event.Event(pygame.USEREVENT, event_data))
        # new event
        event_data = {'ui_element': self,
                      'ui_object_id': self.most_specific_combined_id}
        pygame.event.post(pygame.event.Event(UI_CONFIRMATION_DIALOG_CONFIRMED, event_data))
        self.kill()
    return consumed_event