2022-04-11 18:35:28 +01:00
|
|
|
import tkinter as tk
|
|
|
|
from tkinter import ttk
|
|
|
|
|
2022-05-16 22:20:05 +01:00
|
|
|
from .data import _base_values, _configuration
|
2022-04-11 18:35:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Banner(ttk.Frame):
|
|
|
|
def __init__(self, parent):
|
|
|
|
super().__init__()
|
2022-05-10 20:34:29 +01:00
|
|
|
self.parent = parent
|
2022-04-11 18:35:28 +01:00
|
|
|
self.submix = tk.StringVar()
|
2022-05-16 22:20:05 +01:00
|
|
|
self.submix.set(self.target.bus[_configuration.submixes].label)
|
2022-04-11 18:35:28 +01:00
|
|
|
|
2022-04-22 01:27:35 +01:00
|
|
|
self.label = ttk.Label(
|
|
|
|
self,
|
|
|
|
text=f"SUBMIX: {self.submix.get().upper()}",
|
|
|
|
)
|
|
|
|
self.label.grid(column=0, row=0, sticky=(tk.N, tk.S, tk.W, tk.E))
|
2022-04-11 18:35:28 +01:00
|
|
|
|
2022-04-22 01:27:35 +01:00
|
|
|
self.upd_submix()
|
2022-04-11 18:35:28 +01:00
|
|
|
|
|
|
|
@property
|
|
|
|
def target(self):
|
2022-05-14 14:05:48 +01:00
|
|
|
"""returns the current interface"""
|
|
|
|
|
2022-05-10 20:34:29 +01:00
|
|
|
return self.parent.target
|
2022-04-11 18:35:28 +01:00
|
|
|
|
|
|
|
def upd_submix(self):
|
|
|
|
self.after(1, self.upd_submix_step)
|
|
|
|
|
|
|
|
def upd_submix_step(self):
|
2022-05-10 20:34:29 +01:00
|
|
|
if not _base_values.dragging:
|
2022-05-16 22:20:05 +01:00
|
|
|
self.submix.set(self.target.bus[_configuration.submixes].label)
|
2022-04-11 18:35:28 +01:00
|
|
|
self.label["text"] = f"SUBMIX: {self.submix.get().upper()}"
|
|
|
|
self.after(100, self.upd_submix_step)
|