From f8a3d6dad23d3f7c29f624a3a7df71b63e4b9658 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Tue, 27 Nov 2018 14:26:36 -0500 Subject: [PATCH] GetScreenDimensions for Windows --- PySimpleGUIQt/PySimpleGUIQt.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PySimpleGUIQt/PySimpleGUIQt.py b/PySimpleGUIQt/PySimpleGUIQt.py index 691262e1..a082760c 100644 --- a/PySimpleGUIQt/PySimpleGUIQt.py +++ b/PySimpleGUIQt/PySimpleGUIQt.py @@ -3228,8 +3228,13 @@ class Window: print('*** Error loading form to disk ***') def GetScreenDimensions(self): - # TODO - screen_width = screen_height = 0 + try: + screen = _my_windows.QTApplication.primaryScreen() + except: + return None, None + size = screen.size() + screen_width = size.width() + screen_height = size.height() return screen_width, screen_height def Move(self, x, y):