From 4d756d58cb03eecbb1a995efc4aeaf21f294466c Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Fri, 24 May 2019 23:52:35 -0400 Subject: [PATCH] Refresh of debugger --- DemoPrograms/Demo_Debugger_Integration.py | 16 ++++++++-------- PySimpleGUIdebugger/Demo_Debugger_Integration.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/DemoPrograms/Demo_Debugger_Integration.py b/DemoPrograms/Demo_Debugger_Integration.py index a708701f..630313c4 100644 --- a/DemoPrograms/Demo_Debugger_Integration.py +++ b/DemoPrograms/Demo_Debugger_Integration.py @@ -1,13 +1,14 @@ import PySimpleGUI as sg import PySimpleGUIdebugger - """ Demo program that shows you how to integrate the PySimpleGUI Debugger into your program. - There are TWO steps, and they are copy and pastes. + There are THREE steps, and they are copy and pastes. 1. At the top of your app to debug add import PySimpleGUIdebugger - 2. At the end of your app's event loop add + 2. Initialize the debugger by calling: + PySimpleGUIdebugger.initialize() + 2. At the top of your app's event loop add PySimpleGUIdebugger.refresh(locals(), globals()) """ @@ -19,23 +20,22 @@ layout = [ [sg.T(' ', key='_OUT_')], [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=(40,6))], + [sg.Output(size=(50,6))], [sg.Ok(), sg.Exit()], ] window = sg.Window('This is your Application Window', layout) - # Variables that we'll use to demonstrate the debugger's features counter = 0 timeout = 100 while True: # Event Loop - PySimpleGUIdebugger.refresh(locals(), globals()) + PySimpleGUIdebugger.refresh(locals(), globals()) # call the debugger to refresh the items being shown event, values = window.Read(timeout=timeout) if event in (None, 'Exit'): break + elif event == 'Ok': + print('You clicked Ok.... this is where print output goes') counter += 1 window.Element('_OUT_').Update(values['_IN_']) - -window.Close() diff --git a/PySimpleGUIdebugger/Demo_Debugger_Integration.py b/PySimpleGUIdebugger/Demo_Debugger_Integration.py index 630313c4..ebf27c92 100644 --- a/PySimpleGUIdebugger/Demo_Debugger_Integration.py +++ b/PySimpleGUIdebugger/Demo_Debugger_Integration.py @@ -12,7 +12,6 @@ import PySimpleGUIdebugger PySimpleGUIdebugger.refresh(locals(), globals()) """ -PySimpleGUIdebugger.initialize() layout = [ [sg.T('A typical PSG application')], @@ -29,6 +28,7 @@ window = sg.Window('This is your Application Window', layout) # Variables that we'll use to demonstrate the debugger's features counter = 0 timeout = 100 +PySimpleGUIdebugger.initialize() while True: # Event Loop PySimpleGUIdebugger.refresh(locals(), globals()) # call the debugger to refresh the items being shown