0

The error says that I cannot use geometry manager pack inside . which already has slaves managed by grid. I would love to hear a way to fix that error (sorry I'm new to stackoverflow)

while True:
        
        while user_input != ans:

            master = Tk()
            master.title("Math")
            master.geometry('400x400')

            eq = generate_equation(stage=current_stage)
            ans = calc(eq) 
            Label(master=master,text=f"score: {score}").grid(row=0,column=2,sticky=W)
            Label(master=master, text=f"{q_num}: {eq}").grid(row=0,column=0 ,sticky=W)

            inputtxt = tkinter.Text(master=master,height = 5, width = 20)
            inputtxt.pack()
            user_input =str(inputtxt.get(1.0,"end-1c"))

            mainloop()
        
        score += 10
        q_num += 1
        if score % 100 == 0:
            current_stage += 1
Guy zvi
  • 77
  • 1
  • 6
  • instead of `.pack` use `.grid` – Matiiss Sep 10 '21 at 10:34
  • 3
    Does this answer your question? [Cannot use geometry manager pack inside](https://stackoverflow.com/questions/23584325/cannot-use-geometry-manager-pack-inside) – PCM Sep 10 '21 at 10:35

0 Answers0