def METHOD_NAME(self, button):
    index = int(self.select_option.value)
    try:
        self.optioncontainer.content[
            index
        ].enabled = not self.optioncontainer.content[index].enabled
    except ValueError as e:
        self.main_window.info_dialog("Oops", str(e))