I've been trying to make a customtkinter value update so that it'll display the final BMI value to the user. It, however, won't update and just displays the value from the initial calculation. Here's the snippet:
class ConfigDisplay(ctk.CTkLabel):
def __init__(display, frame, test):
super().__init__(frame)
frame.bmi_value = display.calc_BMI(frame)
frame.display_bmi.set(frame.bmi_value)
display.configure(text_color='#f0f3f2', font=('Helvetica', 110, 'bold'), textvariable=frame.display_bmi)
# This is intended to calculate the BMI from the given values and display it. I'm having trouble actually displaying it; it displays the initial value, but doesn't update.
def calc_BMI(display, frame):
return round((float(frame.weight_value) / float(frame.display_height.get()) ** 2), 1)
# Calculates BMI and returns it.
I'm not sure how to make it continually update - I've made it work with another widget but for some reason it's being very annoying rn.
The full code is here: https://paste.pythondiscord.com/PK6A