diff --git a/actor.py b/actor.py index e788029..fcc017d 100644 --- a/actor.py +++ b/actor.py @@ -54,10 +54,10 @@ def decide_src_plt_cache_update(pvname): class Actor: - def __init__(self, pvname, cache_size=100): + def __init__(self, container, pvname, cache_size=100): + self.container = container self.src, plt, self.cache, self._update = decide_src_plt_cache_update(pvname) self.plt = Frame(plt) - self.container = None def update(self): self._update(self.plt, self.cache) diff --git a/director.py b/director.py index 38c833b..0309e88 100644 --- a/director.py +++ b/director.py @@ -44,15 +44,13 @@ class Director: for n in line: print("Add PV:", n) try: - a = Actor(n) + a = Actor(figs_row, n) except Exception as e: print("caught:", type(e), e) else: def make_remover(x): #TODO: fix this return lambda: self.remove_plot(x) a.plt.on_click_close(make_remover(a)) - assert a.container is None - a.container = figs_row self.add_plot(a) figs_col.children.append(figs_row) self.plot_container.children.insert(0, figs_col)