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

Method _MenuItemChosenCallback

PySimpleGUI/PySimpleGUI.py:1221–1235  ·  view source on GitHub ↗

Callback function called when user chooses a menu item from menubar, Button Menu or right click menu :param item_chosen: String holding the value chosen. :type item_chosen: str

(self, item_chosen)

Source from the content-addressed store, hash-verified

1219 self.ParentForm.TKroot.tk.call('wm', 'geometry', menu, "+{}+{}".format(winx, winy))
1220
1221 def _MenuItemChosenCallback(self, item_chosen): # TEXT Menu item callback
1222 """
1223 Callback function called when user chooses a menu item from menubar, Button Menu or right click menu
1224
1225 :param item_chosen: String holding the value chosen.
1226 :type item_chosen: str
1227
1228 """
1229 # print('IN MENU ITEM CALLBACK', item_chosen)
1230 self.MenuItemChosen = item_chosen
1231 self.ParentForm.LastButtonClicked = self.MenuItemChosen
1232 self.ParentForm.FormRemainedOpen = True
1233 _exit_mainloop(self.ParentForm, self)
1234 # Window._window_that_exited = self.ParentForm
1235 # self.ParentForm.TKroot.quit() # kick the users out of the mainloop
1236
1237 def _FindReturnKeyBoundButton(self, form):
1238 """

Callers

nothing calls this directly

Calls 1

_exit_mainloopFunction · 0.85

Tested by

no test coverage detected