code: def add_row(self, row_class, rows, grid_sizer, can_delete):
      row = len(rows) + 1
      if row_class == WorkspaceViewObjectsRow:
          color = (
              get_primary_outline_color()
              if row == 1
              else get_secondary_outline_color()
              if row == 2
              else get_tertiary_outline_color()
              if row == 3
              else wx.WHITE
          )
      else:
          color = (
              wx.BLUE
              if row == 1
              else wx.GREEN
              if row == 2
              else wx.RED
              if row == 3
              else wx.WHITE
          )
      vw_row = row_class(self, color, can_delete)
  
      grid_sizer.Add(vw_row.chooser, (row, C_CHOOSER), flag=wx.EXPAND)
      grid_sizer.Add(vw_row.color_ctrl, (row, C_COLOR), flag=wx.EXPAND)
      grid_sizer.Add(
          vw_row.show_check, (row, C_SHOW), flag=wx.ALIGN_CENTER
      )
      grid_sizer.Add(
          vw_row.remove_button, (row, C_REMOVE), flag=wx.ALIGN_CENTER
      )
      rows.append(vw_row)
      if can_delete:
  
          def remove_this_row(
              event,
              rows=rows,
              grid_sizer=grid_sizer,
              remove_button=vw_row.remove_button,
          ):
              self.remove_row(rows, grid_sizer, remove_button)
  
          vw_row.remove_button.Bind(wx.EVT_BUTTON, remove_this_row)
      self.update_menu(self.frame.menu_subplots)
      self.layout()
  
imports: import matplotlib
  import matplotlib.axes
  import numpy
  import wx
  import wx.lib.scrolledpanel
  from cellprofiler_core.constants.measurement import EXPERIMENT
  from cellprofiler_core.constants.measurement import IMAGE
  from cellprofiler_core.constants.measurement import M_LOCATION_CENTER_X
  from cellprofiler_core.constants.measurement import M_LOCATION_CENTER_Y
  from cellprofiler_core.measurement import Measurements
  from cellprofiler_core.preferences import IM_BILINEAR
  from cellprofiler_core.preferences import get_primary_outline_color
  from cellprofiler_core.preferences import get_secondary_outline_color
  from cellprofiler_core.preferences import get_tertiary_outline_color
  from cellprofiler_core.preferences import IM_NEAREST
  from cellprofiler_core.preferences import get_interpolation_mode
  from ..artist import INTERPOLATION_BILINEAR
  from ..artist import INTERPOLATION_NEAREST
  from ..artist import INTERPOLATION_BICUBIC
  from ..artist import MODE_HIDE
  from ..artist import CPImageArtist
  from ..constants.workspace_view import C_CHOOSER, WORKSPACE_VIEWER_HELP
  from ..constants.workspace_view import C_COLOR
  from ..constants.workspace_view import C_SHOW
  from ..constants.workspace_view import C_REMOVE
  from ..help.content import FIGURE_HELP
  from ..html.utils import rst_to_html_fragment
  from ..htmldialog import HTMLDialog
  from ._workspace_view_figure import WorkspaceViewFigure
  from ._workspace_view_image_row import WorkspaceViewImageRow
  from ._workspace_view_mask_row import WorkspaceViewMaskRow
  from ._workspace_view_measurement_row import WorkspaceViewMeasurementRow
  from ._workspace_view_objects_row import WorkspaceViewObjectsRow
label_desc: Use image node_id 8 for calling the WorkspaceView obj's underlying member method code with example usage: obj.add_row(row_class, rows, grid_sizer, can_delete) without return types