From 4200b78bd2278986f52980843642815e7ee38a00 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Mon, 10 Sep 2018 22:51:04 -0400 Subject: [PATCH] Turned off grab_anywhere because text is being copied. Turn off grab_anywhere in PopupGetText --- Demo_Password_Login.py | 8 +++----- PySimpleGUI.py | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Demo_Password_Login.py b/Demo_Password_Login.py index e8a16b96..c6040e3d 100644 --- a/Demo_Password_Login.py +++ b/Demo_Password_Login.py @@ -19,7 +19,7 @@ def HashGeneratorGUI(): ] form = sg.FlexForm('SHA Generator', auto_size_text=False, default_element_size=(10,1), - text_justification='r', return_keyboard_events=True) + text_justification='r', return_keyboard_events=True, grab_anywhere=False) form.Layout(layout) while True: @@ -44,10 +44,8 @@ def PasswordMatches(password, hash): sha1hash = hashlib.sha1() sha1hash.update(password_utf) password_hash = sha1hash.hexdigest() - if password_hash == hash: - return True - else: - return False + return password_hash == hash + login_password_hash = '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8' password = sg.PopupGetText('Password', password_char='*') diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 1634cf1e..ab4dbcdc 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -3224,7 +3224,7 @@ def PopupGetFile(message, default_path='',save_as=False, no_window=False, file_ # Get a single line of text # # ===================================================# def GetTextBox(title, message, default_text='', button_color=None, size=(None, None)): - with FlexForm(title, auto_size_text=True, button_color=button_color) as form: + with FlexForm(title, auto_size_text=True, button_color=button_color, grab_anywhere=False) as form: layout = [[Text(message, auto_size_text=True)], [InputText(default_text=default_text, size=size)], [Submit(), Cancel()]] @@ -3237,7 +3237,7 @@ def GetTextBox(title, message, default_text='', button_color=None, size=(None, N def PopupGetText(message, default_text='', password_char='', button_color=None, size=(None, None)): - with FlexForm(title=message, auto_size_text=True, button_color=button_color) as form: + with FlexForm(title=message, auto_size_text=True, button_color=button_color, grab_anywhere=False) as form: layout = [[Text(message, auto_size_text=True)], [InputText(default_text=default_text, size=size, password_char=password_char)], [Ok(), Cancel()]]