From 9a7d7ac259c1f9f7cf2d512c9c26a758e0ec5fe9 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Mon, 18 Nov 2019 23:18:47 -0500 Subject: [PATCH] Demo of integrating imwatchingyou with PySimpleGUIQt --- .../Demo Programs/Qt_Demo_imwatchingyou.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 PySimpleGUIQt/Demo Programs/Qt_Demo_imwatchingyou.py diff --git a/PySimpleGUIQt/Demo Programs/Qt_Demo_imwatchingyou.py b/PySimpleGUIQt/Demo Programs/Qt_Demo_imwatchingyou.py new file mode 100644 index 00000000..9f64ce21 --- /dev/null +++ b/PySimpleGUIQt/Demo Programs/Qt_Demo_imwatchingyou.py @@ -0,0 +1,23 @@ +import PySimpleGUIQt as sg +import imwatchingyou + +""" + Combining the imwatchingyou debugger package with PySimpleGUIQt + This enables you to have a live debugger / REPL in a running PySimpleGUIQt program +""" +layout = [[sg.Text('My PySimpleGUIQt layout')], + [sg.Button('OK'), sg.Button('Debugger'), sg.B('Popout')]] + +window = sg.Window('My window', layout) + +counter = 0 # something to see updating in the popout window +while True: + event, values = window.Read(timeout=100) + if event is None: + break + if event == 'Debugger': + imwatchingyou.show_debugger_window() + elif event == 'Popout': + imwatchingyou.show_debugger_popout_window() + imwatchingyou.refresh_debugger() + counter += 1