finish mov_avg

This commit is contained in:
2025-04-25 19:49:46 +02:00
parent 58ebddcd48
commit a7091af1b2
5 changed files with 58 additions and 9 deletions

View File

@@ -6,8 +6,10 @@ class Slider:
label_text,
from_, to,
initial_value,
command):
command,
dtype=int):
self.command = command
self.dtype = dtype
self.label = ttk.Label(parent, text=f"{label_text}: {int(initial_value)}")
@@ -16,7 +18,8 @@ class Slider:
def update(self, event=None):
value = self.slider.get()
self.label.config(text=f"{self.label.cget('text').split(':')[0]}: {int(value)}")
value_str = int(value) if self.dtype == int else f'{value:.02f}'
self.label.config(text=f"{self.label.cget('text').split(':')[0]}: {value_str}")
self.command()
def get_value(self):