From 332a47754a4623778d75c45946a0d1256a9bb83a Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Mon, 5 Aug 2019 14:38:42 -0400 Subject: [PATCH] Graph Element drag mouse button UP events changed. Returns key+UP for drag event when mouse is released --- PySimpleGUI.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 54022bb5..0d5569cd 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -version = __version__ = "4.1.0.18 Unreleased - Anniversary Edition" +version = __version__ = "4.2.0.0 Unreleased" # 888888ba .d88888b oo dP .88888. dP dP dP @@ -3124,8 +3124,9 @@ class Graph(Element): :param event: (event) event info from tkinter. Note not used in this method """ - - self.ClickPosition = (None, None) + if not self.DragSubmits: # only report mouse up for drag operations + return + self.ClickPosition = self._convert_canvas_xy_to_xy(event.x, event.y) self.LastButtonClickedWasRealtime = not self.DragSubmits if self.Key is not None: self.ParentForm.LastButtonClicked = self.Key @@ -3134,7 +3135,7 @@ class Graph(Element): if self.ParentForm.CurrentlyRunningMainloop: self.ParentForm.TKroot.quit() if self.DragSubmits: - self.ParentForm.LastButtonClicked = None + self.ParentForm.LastButtonClicked += '+UP' self.MouseButtonDown = False # button callback