Python checkbox variable to use in different class

Viewed 27

I want to use the value of the checkbox inside a class in a different class, how do I do this?

class test1(Frame):
    def __init__(mons, master=None):
        Frame.__init__(mons, master)    

        Z1 = LabelFrame(mons.master, bg="#262526")
        Z1.place(x=125,y=325)
        mons.test1= IntVar(value=0)
        mons.test2= IntVar(value=0)
        mons.testt = customtkinter.CTkCheckBox(Z1, text="Test", variable=mons.test1, onvalue=1,offvalue=0)
        mons.top.grid()

class test:
    def classtest(mons):   
        if mons.test1.get == 1:
           print("yessss")
0 Answers
Related