MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / _MenuItemChosenCallback

Method _MenuItemChosenCallback

PySimpleGUI/PySimpleGUI.py:5443–5456  ·  view source on GitHub ↗

Not a user callable function. Called by tkinter when an item is chosen from the menu. :param item_chosen: The menu item chosen. :type item_chosen: (str)

(self, item_chosen)

Source from the content-addressed store, hash-verified

5441 self.Tearoff = tearoff
5442
5443 def _MenuItemChosenCallback(self, item_chosen): # ButtonMenu Menu Item Chosen Callback
5444 """
5445 Not a user callable function. Called by tkinter when an item is chosen from the menu.
5446
5447 :param item_chosen: The menu item chosen.
5448 :type item_chosen: (str)
5449 """
5450 # print('IN MENU ITEM CALLBACK', item_chosen)
5451 self.MenuItemChosen = item_chosen
5452 self.ParentForm.LastButtonClicked = self.Key
5453 self.ParentForm.FormRemainedOpen = True
5454 # if self.ParentForm.CurrentlyRunningMainloop:
5455 # self.ParentForm.TKroot.quit() # kick the users out of the mainloop
5456 _exit_mainloop(self.ParentForm, self)
5457
5458 def update(self, menu_definition=None, visible=None, image_source=None, image_size=(None, None), image_subsample=None, image_zoom=None, button_text=None, button_color=None):
5459 """

Callers

nothing calls this directly

Calls 1

_exit_mainloopFunction · 0.85

Tested by

no test coverage detected