code: def OnMouseWheel(self, event):
          
  
          # Prevent lost IntCtrl changes
          if self.switching:
              time.sleep(0.1)
              return
  
          value = self.GetValue()
  
          current_time = time.clock()
          if current_time < self.last_change_s + 0.01:
              return
  
          if event.GetWheelRotation() >= event.GetWheelDelta():
              self.SetValue(min(value+1, self.no_tabs-1))
          elif event.GetWheelRotation() <= -event.GetWheelDelta():
              self.SetValue(max(value-1, 0))
docs: Mouse wheel event handler