MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / _exit_mainloop

Function _exit_mainloop

PySimpleGUI/PySimpleGUI.py:12705–12718  ·  view source on GitHub ↗

Used to break out of the tkinter mainloop. Elements can call this to cause a Window.read function to return to use :param exiting_window: The window that wants to exit :type exiting_window: (Window) :param element_causing_event: Element that's causing the exit. Will

(exiting_window, element_causing_event)

Source from the content-addressed store, hash-verified

12703
12704
12705def _exit_mainloop(exiting_window, element_causing_event):
12706 """
12707 Used to break out of the tkinter mainloop. Elements can call this to cause a Window.read function to return to use
12708 :param exiting_window: The window that wants to exit
12709 :type exiting_window: (Window)
12710 :param element_causing_event: Element that's causing the exit. Will be None if not an element that's causing it (could be the window itself)
12711 :type element_causing_event: (Element|None)
12712 """
12713 if exiting_window == Window._window_running_mainloop or Window._root_running_mainloop == Window.hidden_master_root:
12714 exiting_window.element_that_generated_event = element_causing_event
12715 Window._window_that_exited = exiting_window
12716 if Window._root_running_mainloop is not None:
12717 Window._root_running_mainloop.quit()
12718 # print('** Exited window mainloop **')
12719
12720
12721def _timeout_alarm_callback_hidden():

Callers 15

_SpinChangedHandlerMethod · 0.85
ButtonPressCallBackMethod · 0.85
ButtonCallBackMethod · 0.85
motion_call_backMethod · 0.85
_SliderChangedHandlerMethod · 0.85
_treeview_selectedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected