<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_mode_button(self, my_button, state):
 """Notify the controller of a new mode setting."""

        if state:
            # The new mode is the label of the button
            self.controller.set_mode(my_button.get_label())