code: def setMouseMode(self, action):
      mode = None
      if action == self.mouseModes[0]:
          mode = "pan"
      elif action == self.mouseModes[1]:
          mode = "rect"
      if mode is not None:
          self.view().setLeftButtonAction(mode)
  
imports: from ...Qt import QtCore, QtGui, QtWidgets
  from ...WidgetGroup import WidgetGroup
  from .None import axisCtrlTemplate_generic
  import weakref
  from .ViewBox import ViewBox
label_desc: Use image node_id 24 for calling the ViewBoxMenu obj's underlying member method code with example usage: obj.setMouseMode(action) without return types