MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / _generic_callback_handler

Method _generic_callback_handler

PySimpleGUI/PySimpleGUI.py:1309–1330  ·  view source on GitHub ↗

Peforms the actions that were in many of the callback functions previously. Combined so that it's easier to modify and is in 1 place now :param event: From tkinter and is not used :type event: Any :param alternate_to_key: If key is No

(self, alternative_to_key=None, force_key_to_be=None)

Source from the content-addressed store, hash-verified

1307 button_element.ButtonCallBack()
1308
1309 def _generic_callback_handler(self, alternative_to_key=None, force_key_to_be=None):
1310 """
1311 Peforms the actions that were in many of the callback functions previously. Combined so that it's
1312 easier to modify and is in 1 place now
1313
1314 :param event: From tkinter and is not used
1315 :type event: Any
1316 :param alternate_to_key: If key is None, then use this value instead
1317 :type alternate_to_key: Any
1318 """
1319 if force_key_to_be is not None:
1320 self.ParentForm.LastButtonClicked = force_key_to_be
1321 elif self.Key is not None:
1322 self.ParentForm.LastButtonClicked = self.Key
1323 else:
1324 self.ParentForm.LastButtonClicked = alternative_to_key
1325 self.ParentForm.FormRemainedOpen = True
1326
1327 _exit_mainloop(self.ParentForm, self)
1328 # if self.ParentForm.CurrentlyRunningMainloop:
1329 # Window._window_that_exited = self.ParentForm
1330 # self.ParentForm.TKroot.quit() # kick the users out of the mainloop
1331
1332 def _ListboxSelectHandler(self, event):
1333 """

Callers 11

_TextClickedHandlerMethod · 0.95
_ListboxSelectHandlerMethod · 0.95
_SpinboxSelectHandlerMethod · 0.95
_RadioHandlerMethod · 0.95
_CheckboxHandlerMethod · 0.95
_KeyboardHandlerMethod · 0.95
_ClickHandlerMethod · 0.95
_user_bind_callbackMethod · 0.95

Calls 1

_exit_mainloopFunction · 0.85

Tested by

no test coverage detected