Answers for "block window if another window is open tkinter"

1

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
Posted by: Guest on January-08-2021
0

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()
Posted by: Guest on July-13-2021

Python Answers by Framework

Browse Popular Code Answers by Language