Merge pull request #137 from MikeTheWatchGuy/Dev-latest

NEW Demo - Borderless window (no titlebar)
This commit is contained in:
MikeTheWatchGuy 2018-09-06 11:09:37 -04:00 committed by GitHub
commit c84ae628f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 0 deletions

33
Demo_Borderless_Window.py Normal file
View File

@ -0,0 +1,33 @@
def TightLayout():
"""
Turn off padding in order to get a really tight looking layout.
"""
import PySimpleGUI as sg
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)),
sg.T('0', size=(8, 1))],
[sg.T('Customer:', pad=((3, 0), 0)), sg.OptionMenu(values=('Customer 1', 'Customer 2'), size=(20, 1)),
sg.T('1', size=(8, 1))],
[sg.T('Notes:', pad=((3, 0), 0)), sg.In(size=(44, 1), background_color='white', text_color='black')],
[sg.ReadFormButton('Start', button_color=('white', 'black')),
sg.ReadFormButton('Stop', button_color=('white', 'black')),
sg.ReadFormButton('Reset', button_color=('white', '#9B0023')),
sg.ReadFormButton('Submit', button_color=('white', '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':
return
TightLayout()