refactor ldirty, add reinitialize level arrays in _make_app

refactor set ldirty.

reinitialize level arrays in _make_app (when switching between local,network connection)
This commit is contained in:
onyx-and-iris
2022-04-17 09:27:27 +01:00
parent cd4264be8b
commit da9e538cc7
2 changed files with 14 additions and 6 deletions

View File

@@ -346,15 +346,15 @@ class ChannelFrame(ttk.Frame):
# create labelframes
if is_strip:
self.strips = [
self.strips = tuple(
Strip(self, i, self.identifier)
for i in range(self.phys_in + self.virt_in)
]
)
else:
self.buses = [
self.buses = tuple(
Bus(self, i, self.identifier)
for i in range(self.phys_out + self.virt_out)
]
)
# position label frames. destroy any without label text
self.labelframes = self.strips if is_strip else self.buses
@@ -367,6 +367,12 @@ class ChannelFrame(ttk.Frame):
self.columnconfigure(i, minsize=0)
labelframe.grid_remove()
for i, labelframe in enumerate(self.labelframes):
labelframe.grid(row=0, column=i)
if not labelframe.cget("text"):
self.columnconfigure(i, minsize=0)
labelframe.grid_remove()
@property
def target(self):
"""returns the current interface"""