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()

        Toggle between display modes 'ip' and 'status'
        
py3status/modules/whatismyip.py