code: def remove_object(self, object=0, delete=True):
          
          if type(object) in [int, int]: n = object
          else:                           n = self.objects.index(object)
  
          # pop it from the list
          object = self.objects.pop(n)
  
          # remove it from the GUI and delete it
          if hasattr_safe(object, '_widget'):
              self._layout.removeWidget(object._widget)
              object._widget.hide()
              if delete: object._widget.deleteLater()
          else:
              self._layout.removeWidget(object)
              object.hide()
              if delete: object.deleteLater()
docs: Removes the supplied object from the grid. If object is an integer,
          it removes the n'th object.