From 6f55c367db4245c43d18692d67699e27654bccd8 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Tue, 12 May 2020 10:39:17 -0400 Subject: [PATCH] Fixed layout undefined error due to window created at wrong location in file. --- DemoPrograms/Demo_PDF_Viewer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/DemoPrograms/Demo_PDF_Viewer.py b/DemoPrograms/Demo_PDF_Viewer.py index 52a82bf8..bf4dc66d 100644 --- a/DemoPrograms/Demo_PDF_Viewer.py +++ b/DemoPrograms/Demo_PDF_Viewer.py @@ -87,8 +87,6 @@ def get_page(pno, zoom=0): return pix.getPNGData() # return the PNG image -window = sg.Window(title, layout, - return_keyboard_events=True, use_default_focus=False) cur_page = 0 data = get_page(cur_page) # show page 1 for start @@ -115,6 +113,11 @@ my_keys = ("Next", "Next:34", "Prev", "Prior:33", "Top-L", "Top-R", "Bot-L", "Bot-R", "MouseWheel:Down", "MouseWheel:Up") zoom_buttons = ("Top-L", "Top-R", "Bot-L", "Bot-R") + + +window = sg.Window(title, layout, + return_keyboard_events=True, use_default_focus=False) + old_page = 0 old_zoom = 0 # used for zoom on/off # the zoom buttons work in on/off mode.