add view class

This commit is contained in:
2025-04-27 14:30:40 +02:00
parent 9a956ac116
commit 2c2933f0cb
4 changed files with 63 additions and 27 deletions

9
frontend/views/number.py Normal file
View File

@@ -0,0 +1,9 @@
from .base import View
class NumberView(View):
def _init_canvas(self):
self.label = self.canvas.create_text(50, 68, text="0.0 g", font=("Arial", 18), fill='black', justify='left')
def update_weight(self, weight):
self.canvas.itemconfig(self.label, text=f"{weight:.1f} g")