How to get a value to update in custom tkinter?

DISCLAIMER # ( I’m not sure why all of the of code is indented wrong on here but i can assure you that it’s correct in the actual ide code ).

Hello, I’m trying to update vales for a total variable but I’ve noticed the text variables don’t update in labels, Any way to fix this?
Say a value is 0 then i add one to it to then it should become 1 but The customtkinter text is still 0.
Here’s the full code I guess.

import pickle
import customtkinter
from tkinter import *
import tkinter as tk
# List of chores
Chores_list = [" Wipe table"," Vacuum floors"," Tape posters"," Take out garbage"," Make bed"]
Completed_chores_list = ["Completed chores list: "]

# UI Settings
root = customtkinter.CTk()
root.geometry("500x500")
root.resizable(False,False)
root.title("Chores List")
# UI variables
chores = """Chores
                   """
font = "Rockwell Nova"
total_chores = """Total Chores Completed
__________________
__________"""
total_chores_completed = 0
range_v = 0
range_v == range(0,4)
while True:
    # Defines something
    def chore_completed():
        global total_chores_completed
        global range_v
        total_chores_completed += 1
        range_v +=1
    # CustomTkinter window UI
        # Makes Title frame
    frame1 = customtkinter.CTkFrame(master=root,width=450,height=70,corner_radius=5)

    frame1.pack(padx=20,pady=20)
    
    # Makes Frames
    frame2 = customtkinter.CTkFrame(root,width=100,height=380,corner_radius=5)
    frame2.place(relx=0.05,rely=0.2)

    frame3 = customtkinter.CTkFrame(root,width=100,height=380,corner_radius=5)
    frame3.place(relx=0.74,rely=0.2)

    frame4 = customtkinter.CTkFrame(root,width=200,height=50,corner_radius=20)
    frame4.pack(pady=1,padx=20)

    frame5 = customtkinter.CTkFrame(root,width=200,height=50,corner_radius=20)
    frame5.pack(pady=3,padx=20)

    frame6 = customtkinter.CTkFrame(root,corner_radius=30)
    frame6.place(rely=0.58,relx=0.3)


    # Makes a label 
    label1 = customtkinter.CTkLabel(frame4,width=161,height=50,corner_radius=5,text="Current chore: ")
    label1.pack(pady=1,padx=20)

    label2 = customtkinter.CTkLabel(frame6,text=total_chores,font=(font,13),)
    label2.pack(padx=20,pady=30)

    label3 = customtkinter.CTkLabel(frame6,text=total_chores_completed,font=(font,20),width=160,height=70,corner_radius=20)
    label3.pack(padx=20,pady=3)
    
    label4 = customtkinter.CTkLabel(frame5,text=Chores_list[range_v],width=50,height=50)
    label4.place(relx=0.3,rely=0.05)
    # Makes buttons

    button1 = customtkinter.CTkButton(root,text="Done",width=100,height=30,fg_color="#a9a9a9",command=chore_completed)
    button1.place(relx=0.3,rely=0.5)

    button2 = customtkinter.CTkButton(root,text="Skip",width=100,height=30,fg_color="#a9a9a9")
    button2.place(relx=0.51,rely=0.5)

    for i in range(10):
        frame2_chores = customtkinter.CTkLabel(frame2,text=chores,font=(font,12.5),corner_radius=10)
        frame2_chores.pack(padx=15,pady=1)
    for i in range(10):
        frame3_chores = customtkinter.CTkLabel(frame3,text=chores,font=(font,12.5),corner_radius=10)
        frame3_chores.pack(padx=15,pady=1)
    
    
    # Makes a title
    title = customtkinter.CTkLabel(master=frame1,text="To-Do-List",font=(font,31),text_color="#a9a9a9")
    title.place(relx=0.5,rely=0.5, anchor = tk.CENTER)

    
    

    # Puts root into a loop
    root.mainloop()

Here’s the specific part i want to focus on.

    label4 =  
customtkinter.CTkLabel(frame5,text=Chores_list[range_v],width=50,height=50)
    label4.place(relx=0.3,rely=0.05)

I have range_v set to 0 and it goes up by one every time i click the “done” button which makes the Chores_list to also go up by one which makes the text change to the next thing in the list.
I also need to do the same thing with updating values for the total chores list but if i can get help with this then it’s pretty much the same concept.
Thanks for any help you can provide :D.
( Not sure what root.update does but that’s a command i found that might help, I’ve got no clue. )

You’re creating the GUI and calling root.mainloop() in a loop, but root.mainloop() returns only when you close the GUI window. This means that your code will try to create the GUI again when you close the GUI.

That’s not how you meant to do it.

You’re meant to create the GUI once and then call root.mainloop(). Your code will then interact with the GUI via the event handlers.

You can change the text of a label by passing a Tk variable instead of static text:

    total_chores_var = IntVar()
    label3 = customtkinter.CTkLabel(frame6,textvariable=total_chores_var,font=(font,20),width=160,height=70,corner_radius=20)
    label3.pack(padx=20,pady=3)
    label4.place(relx=0.3,rely=0.05)
    total_chores_var.set(total_chores_completed)

When you change total_chores_completed, change the value of the Tk variable too:

    total_chores_completed += 1
    total_chores_var.set(total_chores_completed)