Merge pull request #193 from MikeTheWatchGuy/Dev-latest

Turned off grab_anywhere because text is being copied. Turn off grab_…
This commit is contained in:
MikeTheWatchGuy 2018-09-10 22:51:46 -04:00 committed by GitHub
commit 1d056ec2e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -19,7 +19,7 @@ def HashGeneratorGUI():
] ]
form = sg.FlexForm('SHA Generator', auto_size_text=False, default_element_size=(10,1), 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) form.Layout(layout)
while True: while True:
@ -44,10 +44,8 @@ def PasswordMatches(password, hash):
sha1hash = hashlib.sha1() sha1hash = hashlib.sha1()
sha1hash.update(password_utf) sha1hash.update(password_utf)
password_hash = sha1hash.hexdigest() password_hash = sha1hash.hexdigest()
if password_hash == hash: return password_hash == hash
return True
else:
return False
login_password_hash = '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8' login_password_hash = '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8'
password = sg.PopupGetText('Password', password_char='*') password = sg.PopupGetText('Password', password_char='*')

View File

@ -3224,7 +3224,7 @@ def PopupGetFile(message, default_path='',save_as=False, no_window=False, file_
# Get a single line of text # # Get a single line of text #
# ===================================================# # ===================================================#
def GetTextBox(title, message, default_text='', button_color=None, size=(None, None)): 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)], layout = [[Text(message, auto_size_text=True)],
[InputText(default_text=default_text, size=size)], [InputText(default_text=default_text, size=size)],
[Submit(), Cancel()]] [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)): 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)], layout = [[Text(message, auto_size_text=True)],
[InputText(default_text=default_text, size=size, password_char=password_char)], [InputText(default_text=default_text, size=size, password_char=password_char)],
[Ok(), Cancel()]] [Ok(), Cancel()]]