code: def OnCopyResult(self, event):
          
  
          selection = self.main_window.grid.selection
          data = self.main_window.actions.copy_result(selection)
  
          # Check if result is a bitmap
          if type(data) is wx._gdi.Bitmap:
              # Copy bitmap to clipboard
              self.main_window.clipboard.set_clipboard(data, datatype="bitmap")
  
          else:
              # Copy string representation of result to clipboard
  
              self.main_window.clipboard.set_clipboard(data, datatype="text")
  
          event.Skip()
docs: Clipboard copy results event handler