def onDeleteWidget(self): """Called when widget is deleted. This should be called by Red-R Core only. """ for k in self.Rvariables: #print self.Rvariables[k] self.R('if(exists("' + self.Rvariables[k] + '")) { rm(' + self.Rvariables[k] + ') }', wantType = 'NoConversion') """The widget must also call the delete function in all of it's qtWidgets because these may have consequences that we don't want lying around.""" try: self.controlArea.deleteWidget() except: redRLog.log(redRLog.REDRCORE, redRLog.DEVEL, redRLog.formatException()) # send none through the signals globalData.removeGlobalData(self) self.outputs.propogateNone(ask = False) self.outputs.clearAll() self.customWidgetDelete()
def customWidgetDelete(self): try: globalData.removeGlobalData(self) except Exception as inst: self.log(str(inst))