Major update of all demo programs to use new PEP8 bindings, etc
This commit is contained in:
parent
3f7c87c562
commit
7f52778bcc
307 changed files with 19546 additions and 3297 deletions
|
@ -1,5 +1,4 @@
|
|||
import PySimpleGUI as sg
|
||||
# import imwatchingyou # Not needed because using the one inside PySimpleGUI.py code itself
|
||||
|
||||
"""
|
||||
Demo program that shows you how to integrate the PySimpleGUI Debugger
|
||||
|
@ -20,36 +19,38 @@ import PySimpleGUI as sg
|
|||
"""
|
||||
|
||||
layout = [
|
||||
[sg.T('A typical PSG application')],
|
||||
[sg.In(key='_IN_')],
|
||||
[sg.T(' ', key='_OUT_', size=(45,1))],
|
||||
[sg.CBox('Checkbox 1'), sg.CBox('Checkbox 2')],
|
||||
[sg.Radio('a',1, key='_R1_'), sg.Radio('b',1, key='_R2_'), sg.Radio('c',1, key='_R3_')],
|
||||
[sg.Combo(['c1', 'c2', 'c3'], size=(6,3), key='_COMBO_')],
|
||||
[sg.Output(size=(50,6))],
|
||||
[sg.Ok(), sg.Exit(), sg.Button('Enable'), sg.Button('Popout'), sg.Button('Debugger'), sg.Debug(key='Debug')],
|
||||
]
|
||||
[sg.Text('A typical PSG application')],
|
||||
[sg.Input(key='-IN-')],
|
||||
[sg.Text(' ', key='-OUT-', size=(45, 1))],
|
||||
[sg.CBox('Checkbox 1'), sg.CBox('Checkbox 2')],
|
||||
[sg.Radio('a', 1, key='-R1-'), sg.Radio('b', 1, key='-R2-'),
|
||||
sg.Radio('c', 1, key='-R3-')],
|
||||
[sg.Combo(['c1', 'c2', 'c3'], size=(6, 3), key='-COMBO-')],
|
||||
[sg.Output(size=(50, 6))],
|
||||
[sg.Ok(), sg.Exit(), sg.Button('Enable'), sg.Button('Popout'),
|
||||
sg.Button('Debugger'), sg.Debug(key='Debug')],
|
||||
]
|
||||
|
||||
window = sg.Window('This is your Application Window', layout, debugger_enabled=False)
|
||||
window = sg.Window('This is your Application Window',
|
||||
layout, debugger_enabled=False)
|
||||
|
||||
counter = 0
|
||||
timeout = 100
|
||||
|
||||
# Note that you can launch the debugger windows right away, without waiting for user input
|
||||
sg.show_debugger_popout_window()
|
||||
|
||||
while True: # Your Event Loop
|
||||
event, values = window.Read(timeout=timeout)
|
||||
event, values = window.read(timeout=100)
|
||||
if event in (None, 'Exit'):
|
||||
break
|
||||
elif event == 'Enable':
|
||||
window.EnableDebugger()
|
||||
window.enable_debugger()
|
||||
elif event == 'Popout':
|
||||
sg.show_debugger_popout_window() # replaces old popout with a new one, possibly with new variables`
|
||||
# replaces old popout with a new one, possibly with new variables`
|
||||
sg.show_debugger_popout_window()
|
||||
elif event == 'Debugger':
|
||||
sg.show_debugger_window()
|
||||
counter += 1
|
||||
# to prove window is operating, show the input in another area in the window.
|
||||
window.Element('_OUT_').Update(values['_IN_'])
|
||||
window['-OUT-'].update(values['-IN-'])
|
||||
|
||||
window.Close()
|
||||
window.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue