Added some text, added use of Debug Window to display values since may be running from the Demo Browser where prints are not shown
This commit is contained in:
parent
40567418db
commit
ee7179fb3a
|
@ -10,16 +10,17 @@ import PySimpleGUI as sg
|
|||
This Spin element will wrap around going in either direction. When getting to the end then
|
||||
it will go back to the beginning.
|
||||
|
||||
Copyright 2021 PySimpleGUI
|
||||
Copyright 2022 PySimpleGUI
|
||||
"""
|
||||
|
||||
|
||||
lower, upper = 0, 10
|
||||
data = [i for i in range(lower - 1, upper + 2)]
|
||||
|
||||
layout = [[sg.Spin(data, initial_value=lower, readonly=True, size=3, enable_events=True, key='-SPIN-')]]
|
||||
layout = [[sg.Text('This Spin element wraps around in both directions')],
|
||||
[sg.Spin(data, initial_value=lower, readonly=True, size=3, enable_events=True, key='-SPIN-')]]
|
||||
|
||||
window = sg.Window('Title', layout, font='_ 18')
|
||||
window = sg.Window('Wrapping Spin Element', layout, font='_ 18', keep_on_top=True)
|
||||
|
||||
while True:
|
||||
|
||||
|
@ -38,6 +39,6 @@ while True:
|
|||
window['-SPIN-'].update(value=lower)
|
||||
values['-SPIN-'] = lower # Change the values dictionary too so it'll be correct if used
|
||||
|
||||
print(values['-SPIN-'])
|
||||
sg.Print('Spin Value:', values['-SPIN-'], relative_location=(-400, 0))
|
||||
|
||||
window.close()
|
Loading…
Reference in New Issue