class_docstr: This class draws a rectangular area. Right-clicking inside the area will
  raise a custom context menu which also includes the context menus of
  its parents.    
class_docstr_tok: ["This","class","draws","a","rectangular","area",".","Right-clicking","inside","the","area","will","raise","a","custom","context","menu","which","also","includes","the","context","menus","of","its","parents","."]
code: def getContextMenus(self, event=None):
      if self.menu is None:
          self.menu = QtWidgets.QMenu()
          self.menu.setTitle(self.name + " options..")
  
          green = QtGui.QAction("Turn green", self.menu)
          green.triggered.connect(self.setGreen)
          self.menu.addAction(green)
          self.menu.green = green
  
          blue = QtGui.QAction("Turn blue", self.menu)
          blue.triggered.connect(self.setBlue)
          self.menu.addAction(blue)
          self.menu.green = blue
  
          alpha = QtWidgets.QWidgetAction(self.menu)
          alphaSlider = QtWidgets.QSlider()
          alphaSlider.setOrientation(QtCore.Qt.Orientation.Horizontal)
          alphaSlider.setMaximum(255)
          alphaSlider.setValue(255)
          alphaSlider.valueChanged.connect(self.setAlpha)
          alpha.setDefaultWidget(alphaSlider)
          self.menu.addAction(alpha)
          self.menu.alpha = alpha
          self.menu.alphaSlider = alphaSlider
      return self.menu
  
file_path: pyqtgraph/pyqtgraph/examples/contextMenu.py
imports: import pyqtgraph
  from pyqtgraph.Qt import QtCore, QtGui, QtWidgets
label_desc: Use image node_id 6 for calling the MenuBox obj's underlying member method code with example usage: obj.getContextMenus(event) and returns: self