Turn off grab_anywhere on Demos of realtime buttons due to error message from tkinter

This commit is contained in:
MikeTheWatchGuy 2018-09-07 10:33:23 -04:00
parent c905acdd3d
commit fdab86b66f
5 changed files with 16 additions and 17 deletions

View file

@ -1,8 +1,9 @@
import PySimpleGUI as sg
"""
Turn off padding in order to get a really tight looking layout.
"""
sg.ChangeLookAndFeel('Dark')
sg.SetOptions(element_padding=(0, 0))
layout = [[sg.T('User:', pad=((3, 0), 0)), sg.OptionMenu(values=('User 1', 'User 2'), size=(20, 1)),
@ -15,10 +16,13 @@ layout = [[sg.T('User:', pad=((3, 0), 0)), sg.OptionMenu(values=('User 1', 'User
sg.ReadFormButton('Reset', button_color=('white', '#9B0023')),
sg.ReadFormButton('Submit', button_color=('gray60', 'springgreen4')),
sg.SimpleButton('Exit', button_color=('white', '#00406B'))]]
form = sg.FlexForm("Time Tracker", default_element_size=(12, 1), text_justification='r', auto_size_text=False,
auto_size_buttons=False, no_titlebar=True,
default_button_element_size=(12, 1))
form.Layout(layout)
while True:
button, values = form.Read()
if button is None or button == 'Exit':