code: def on_mode_button(self, my_button, state):
          
          if state:
              # The new mode is the label of the button
              self.controller.set_mode(my_button.get_label())
docs: Notify the controller of a new mode setting.