Skip to content

Commit ad5b826

Browse files
authored
Merge pull request PySimpleGUI#5526 from PySimpleGUI/Dev-latest
Fix for continuous mouse up events from Graph element when reading wi…
2 parents 18d656b + 1140e01 commit ad5b826

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

PySimpleGUI.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python3
22

3-
version = __version__ = "4.60.0.14 Unreleased"
3+
version = __version__ = "4.60.0.15 Unreleased"
44

55
_change_log = """
66
Changelog since 4.60.0 released to PyPI on 8-May-2022
@@ -40,6 +40,8 @@
4040
Added Window.unbind
4141
4.60.0.14
4242
Added (None, None) to the Window docstring
43+
4.60.0.15
44+
Fix for continuous Graph element mouse up events when reading with a timeout=0. Big thank you to @davesmivers (THANKS DAVE!!) for finding and fixing
4345
"""
4446

4547
__version__ = version.split()[0] # For PEP 396 and PEP 345
@@ -6468,25 +6470,22 @@ def button_release_call_back(self, event):
64686470
:param event: (event) event info from tkinter. Note not used in this method
64696471
:type event:
64706472
"""
6471-
if not self.DragSubmits: # only report mouse up for drag operations
6472-
return
6473+
if not self.DragSubmits:
6474+
return # only report mouse up for drag operations
64736475
self.ClickPosition = self._convert_canvas_xy_to_xy(event.x, event.y)
6474-
self.LastButtonClickedWasRealtime = not self.DragSubmits
6476+
self.ParentForm.LastButtonClickedWasRealtime = False
64756477
if self.Key is not None:
64766478
self.ParentForm.LastButtonClicked = self.Key
64776479
else:
64786480
self.ParentForm.LastButtonClicked = '__GRAPH__' # need to put something rather than None
6479-
# if self.ParentForm.CurrentlyRunningMainloop:
6480-
# self.ParentForm.TKroot.quit()
64816481
_exit_mainloop(self.ParentForm)
6482-
if self.DragSubmits:
6483-
if isinstance(self.ParentForm.LastButtonClicked, str):
6484-
self.ParentForm.LastButtonClicked = self.ParentForm.LastButtonClicked + '+UP'
6485-
else:
6486-
self.ParentForm.LastButtonClicked = (self.ParentForm.LastButtonClicked, '+UP')
6487-
# self.ParentForm.LastButtonClicked += '+UP' # this is the old method that required string key
6482+
if isinstance(self.ParentForm.LastButtonClicked, str):
6483+
self.ParentForm.LastButtonClicked = self.ParentForm.LastButtonClicked + '+UP'
6484+
else:
6485+
self.ParentForm.LastButtonClicked = (self.ParentForm.LastButtonClicked, '+UP')
64886486
self.MouseButtonDown = False
64896487

6488+
64906489
# button callback
64916490
def button_press_call_back(self, event):
64926491
"""

0 commit comments

Comments
 (0)