block window if another window is open tkinter
b.grab_set() # when you show the popup
# do stuff ...
b.grab_release() # to return to normal
block window if another window is open tkinter
b.grab_set() # when you show the popup
# do stuff ...
b.grab_release() # to return to normal
block window if another window is open tkinter
You can also do this with an if statement:
if wind1 is not None and win1.winfo_exists():
pass
else:
wind1 = tk.Tk()
wind1.title('Window 1')
w1button1 = ttk.Button(wind1,text='Launch Window 2', command=startwind2)
w1button1.pack()
w1button2 = ttk.Button(wind1,text='Check if Window 2 exists',command=checkwind2)
w1button2.pack()
wind1.mainloop()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us