D
D
Durilka962021-12-30 19:56:26
Python
Durilka96, 2021-12-30 19:56:26

How to access dynamically created tkinter widgets?

How can I dynamically click on the created edit button to get data from them?
I create code like this

def test_dinamic():
    doth=tix.Tk()
    p=1
    frames = []
    widgets = []
    frame = Frame(doth, borderwidth=2, relief="groove")
    frames.append(frame)
    frame.pack(side="top", fill="x")
    for i in range(3):
        widget = Entry(frame)
        widgets.append(widget)
        widget.pack(side="left")
    buttonFrame=Button(frame,text="ок", command=testprint)
    buttonFrame.pack(side="right")
    doth.mainloop()

def testprint():

Or is it better to create in another way?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question