finish mov_avg
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user