I'm building a Tkinter app that will ask users to set a password before using the computer. Therefore, it needs to be unclosable, which includes disabling Alt+F4.
I have tried using root.protocol("WM_DELETE_WINDOW", preventClose)
where preventClose
is a function (shown below). Note: This is not a duplicate of override alt-f4 closing tkinter window in python 3.6 and replace it with something else. I want a completely unclosable window, not just to remap Alt+F4.
This is the method I've tried using the preventClose
function:
def preventClose():
pass
and this Tkinter protocol:
root.protocol("WM_DELETE_WINDOW", preventClose)
This has not been able to disable Alt+F4 like described in Unclosable window using tkinter.
I do not see any error messages, but Alt+F4 is not disabled like I want it to be.
Some basic information:
- Windows 10 Home 64-bit
- Python 3.7