<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_click(self, event):
 """ Toggle between display modes 'ip' and 'status' """

        button = event["button"]
        if button == self.button_toggle:
            self.toggled = True
            if self.mode == "ip":
                self.mode = "status"
            else:
                self.mode = "ip"
        elif button == self.button_refresh:
            self.idle_time = 0
        else:
            self.py3.prevent_refresh()