Table - change_submits parameter, Slider enable/disable, update.

This commit is contained in:
MikeTheWatchGuy 2018-11-10 17:26:59 -05:00
parent 418ef2ec8b
commit e78ae0424a
3 changed files with 48 additions and 9 deletions

View file

@ -2,7 +2,11 @@ import PySimpleGUIQt as sg
layout = [
[sg.Text('This is the new Dial Element!')],
[sg.Dial(range=(1,100), key='_DIAL_')],
[sg.T(' ', size=(70,10)), sg.T('0', key='+DIAL_VALUE+', font=('Helvetica', 15))],
[sg.Dial(range=(1,100), key='_DIAL_', change_submits=True)],
[sg.Slider((1,100), orientation='h', key='_SLIDER_', change_submits=True),
sg.T(' 1', key='+SLIDER_VALUE+', font=('Helvetica', 15))],
[sg.T('1' + 30*' ' + '100')],
[sg.Button('Show'), sg.Button('Exit')]
]
@ -10,8 +14,9 @@ window = sg.Window('Window Title').Layout(layout)
while True: # Event Loop
event, values = window.Read()
print(event, values)
if event is None or event == 'Exit':
break
window.FindElement('+DIAL_VALUE+').Update(values['_DIAL_'])
window.FindElement('+SLIDER_VALUE+').Update(values['_SLIDER_'])
window.Close()