diff --git a/actor.py b/actor.py index 669830b..10f59e7 100644 --- a/actor.py +++ b/actor.py @@ -56,17 +56,19 @@ class Actor: def __init__(self, pvname, cache_size=100): self.pvname = pvname - self.src, plt, self.cache, self._update = decide_src_plt_cache_update(pvname) - self.plt = Frame(plt) + self.src, plt, cache, self._update = decide_src_plt_cache_update(pvname) + self.cache = cache + self.plt = plt + self.frm = frm = Frame(plt) - self.plt.cfg_ti_cache_size.value = str(self.cache.size) - self.plt.cfg_ti_cache_size.on_change("value", self.do_update_cache_size) + self.frm.cfg_ti_cache_size.value = str(cache.size) + self.frm.cfg_ti_cache_size.on_change("value", self.do_update_cache_size) def do_update_cache_size(self, attr, old, new): print(f"CB Update cache size: attribute \"{attr}\" changed from \"{old}\" to \"{new}\"") self.cache.set_size(int(new)) - self.plt.cfg_ti_cache_size.value = str(self.cache.size) + self.frm.cfg_ti_cache_size.value = str(self.cache.size) def update(self): diff --git a/director.py b/director.py index 7ddc23c..9b64d58 100644 --- a/director.py +++ b/director.py @@ -64,9 +64,9 @@ class Director: def add_actor(self, a, container): print("Add:", a) print("Connect close button") - a.plt.on_click_close(lambda: self.remove_actor(a, container)) + a.frm.on_click_close(lambda: self.remove_actor(a, container)) print("Add plot") - container.append(a.plt) + container.append(a.frm) print("Add update") self.updates.append(a.update) @@ -76,7 +76,7 @@ class Director: print("Remove update") self.updates.remove(a.update) print("Remove plot") - container.remove(a.plt) + container.remove(a.frm) diff --git a/frame.py b/frame.py index 5da4dd9..c07a2c1 100644 --- a/frame.py +++ b/frame.py @@ -12,7 +12,7 @@ class Frame(Column): def __init__(self, plt): self.plt = plt - self.set = plt.set # make frame act like contained plot +# self.set = plt.set # make frame act like contained plot name = plt.name inner_fig = plt.layout