From 40bee69a364323708e91e02e8a1513002690676a Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sun, 18 Oct 2020 11:31:52 -0400 Subject: [PATCH] Added Window.set_cursor --- PySimpleGUI.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index c983a4d5..431a6543 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -version = "4.30.0.2 Unreleased \nAdded ability to set icon for popup_get_file when icon is set as parameter, changed __version__ to be same as 'ver' (the shortened version number)" +version = "4.30.0.3 Unreleased \nAdded ability to set icon for popup_get_file when icon is set as parameter, changed __version__ to be same as 'ver' (the shortened version number), added Window.set_cursor" # The shortened version of version try: @@ -8788,6 +8788,20 @@ class Window: + def set_cursor(self, cursor): + """ + Sets the cursor for the window. + :param cursor: The tkinter cursor name + :type cursor: (str) + """ + if not self._is_window_created(): + return + try: + self.TKroot.config(cursor=cursor) + except Exception as e: + print('Warning bad cursor specified ', cursor) + print(e) + def _window_tkvar_changed_callback(self, event, *args): """ Internal callback function for when the thread