I implemented the code in a new window in tkinter
win = tk.Tk()
def tt():
print("tt")
win.title("win1")
def com():
win2 = tk.Toplevel(win)
win.title("win2")
Button = tk.Button(win2,text="click",command = tt())
Button.pack()
win2.mainloop()
Button = tk.Button(win,text="click",command = com)
Button.pack()
win.mainloop()
When I implemented the code like this, it could not be executed, so I gave the grab_set() option knowing that I had to deactivate the parent.
win2.grab_set()
However, the button in win2 only works when the button is pressed in 'win' and does not work when pressed in win2. What should I do