MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / motion_call_back

Method motion_call_back

PySimpleGUI/PySimpleGUI.py:6847–6870  ·  view source on GitHub ↗

Not a user callable method. Used to get Graph mouse motion events. Called by tkinter when mouse moved :param event: (event) event info from tkinter. Contains the x and y coordinates of a mouse :type event:

(self, event)

Source from the content-addressed store, hash-verified

6845
6846 # button callback
6847 def motion_call_back(self, event):
6848 """
6849 Not a user callable method. Used to get Graph mouse motion events. Called by tkinter when mouse moved
6850
6851 :param event: (event) event info from tkinter. Contains the x and y coordinates of a mouse
6852 :type event:
6853 """
6854
6855 if not self.MouseButtonDown and not self.motion_events:
6856 return
6857 self.ClickPosition = self._convert_canvas_xy_to_xy(event.x, event.y)
6858 self.ParentForm.LastButtonClickedWasRealtime = self.DragSubmits
6859 if self.Key is not None:
6860 self.ParentForm.LastButtonClicked = self.Key
6861 else:
6862 self.ParentForm.LastButtonClicked = '__GRAPH__' # need to put something rather than None
6863 # if self.ParentForm.CurrentlyRunningMainloop:
6864 # self.ParentForm.TKroot.quit() # kick out of loop if read was called
6865 if self.motion_events and not self.MouseButtonDown:
6866 if isinstance(self.ParentForm.LastButtonClicked, str):
6867 self.ParentForm.LastButtonClicked = self.ParentForm.LastButtonClicked + '+MOVE'
6868 else:
6869 self.ParentForm.LastButtonClicked = (self.ParentForm.LastButtonClicked, '+MOVE')
6870 _exit_mainloop(self.ParentForm, self)
6871
6872 BringFigureToFront = bring_figure_to_front
6873 ButtonPressCallBack = button_press_call_back

Callers

nothing calls this directly

Calls 2

_exit_mainloopFunction · 0.85

Tested by

no test coverage detected