Merge pull request #426 from MikeTheWatchGuy/Dev-latest

Dev latest
This commit is contained in:
MikeTheWatchGuy 2018-10-06 01:08:33 -04:00 committed by GitHub
commit 43d3ef8bf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 86 additions and 0 deletions

86
Demo_PSG_SDK_Quick_Ref.py Normal file
View File

@ -0,0 +1,86 @@
import PySimpleGUI as sg
element_list = ('Text',
'InputText',
'CheckBox',
'RadioButton',
'Listbox',
'Slider',
'Multiline',
'Output',
'ProgressBar',
'OptionMenu',
'Menu',
'Frame',
'Column',
'Graph',
'Image',
'Table',
'Tab',
'TabGroup')
desc_text = """
Text( text
size=(None, None)
auto_size_text=None
click_submits=None
relief=None
font=None
text_color=None
background_color=None
justification=None
pad=None
key=None
tooltip=None)"""
desc_inputtext = """
InputText( default_text =''
size=(None, None)
auto_size_text=None
password_char=''
justification=None
background_color=None
text_color=None
font=None
tooltip=None
do_not_clear=False
key=None
focus=False
pad=None)
"""
desc_checkbox = """
CheckBox( text,
default=False
size=(None, None)
auto_size_text=None
font=None
background_color=None
text_color=None
change_submits=False
key=None
pad=None
tooltip=None)
"""
descriptions = {'Text':desc_text, 'InputText':desc_inputtext, 'CheckBox':desc_checkbox}
layout = [[sg.Text('The PySimpleGUI SDK Quick Reference Guide',font='Any 15', relief=sg.RELIEF_RAISED)],
[sg.Listbox(values=element_list, size=(15,len(element_list)), key='_in_', change_submits=True),
sg.Text(desc_text, size=(40,15),font=('Consolas 13'), text_color='darkblue', key='_out_')],
[sg.RButton('Read'), sg.Exit()]]
window = sg.Window('Window that stays open',
font = 'Any 12').Layout(layout)
while True:
button, values = window.Read()
if button is None or button == 'Exit':
break
element = values['_in_'][0]
try:
desc = descriptions[element]
except: desc = ''
window.FindElement('_out_').Update(desc)
print(button, values)