1
I need to disable window options made in Pysimplegui and allow closing only if you hit the password in a text box.
my code:
sg.theme('DarkRed')
layout = [
    [sg.Text('Senha'), sg.Input(key='senha', password_char='*')],
    [sg.Button('Liberar')]
]
janela = sg.Window('', layout)
while True:
    eventos, valores = janela.read()
    if eventos == sg.WINDOW_CLOSED:
        Mbox('Titulo', 'Você não pode fechar', 0)
        continue     
    if eventos == 'Liberar':
        if valores ['senha'] == '123456':
            Mbox('Titulo', 'Liberado', 0)
            break
        
        else:
            Mbox('Titulo', 'Senha errada', 0)
Below the sg.WINDOW_CLOSED I’ve tried to put a continue or a pass but it didn’t work.
Some way to disable the function, hide or make the program open every time it is closed?
Thank you!! Gave straight, I will read more about this method
– Faber