def destroy(self, button=None): """Die a horrible death.""" for polygon in self.polygons: MapView.remove_layer(polygon) self.polygons.clear() self.widgets.trackfile_settings.destroy() del self.cache[self.filename] TrackFile.instances.discard(self) points.clear() for trackfile in TrackFile.instances: points.update(trackfile.tracks) TrackFile.update_range()
def clear_all(*ignore): """Forget all GPX data, start over with a clean slate.""" for trackfile in list(TrackFile.instances): trackfile.destroy() points.clear()