code: def toggle(self, event):
          
  
          if self.state < len(self.bitmap_list) - 1:
              self.state += 1
          else:
              self.state = 0
  
          self.SetBitmapLabel(self.bitmap_list[self.state])
  
          try:
              event.Skip()
          except AttributeError:
              pass
  
          """For compatibility with toggle buttons"""
          setattr(self, "GetToolState", lambda x: self.state)
docs: Toggles state to next bitmap