Merge pull request #2007 from PySimpleGUI/Dev-latest

New Class Method.  Window.get_screen_size() returns tuple. Can be cal…
This commit is contained in:
PySimpleGUI 2019-09-20 13:15:07 -04:00 committed by GitHub
commit 0eef532517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/python3
version = __version__ = "4.5.0.17 Unreleased Mac Buttons. Element Resizing"
version = __version__ = "4.5.0.18 Unreleased Mac Buttons. Element Resizing. Screen Size"
# 888888ba .d88888b oo dP .88888. dP dP dP
@ -5206,6 +5206,14 @@ class Window:
self.NumOpenWindows -= 1 * (self.NumOpenWindows != 0) # decrement if not 0
# print('----- DECREMENTING Num Open Windows = {} ---'.format(Window.NumOpenWindows))
@classmethod
def get_screen_size(self):
root = tk.Tk()
screen_width = root.winfo_screenwidth() # get window info to move to middle of screen
screen_height = root.winfo_screenheight()
root.destroy()
return screen_width, screen_height
# ------------------------- Add ONE Row to Form ------------------------- #
def AddRow(self, *args):
"""