do not replace plot with frame
This commit is contained in:
@@ -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):
|
||||
|
||||
+3
-3
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user