MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / widget_to_element

Method widget_to_element

PySimpleGUI/PySimpleGUI.py:11022–11036  ·  view source on GitHub ↗

Returns the element that matches a supplied tkinter widget. If no matching element is found, then None is returned. :return: Element that uses the specified widget :rtype: Element | None

(self, widget)

Source from the content-addressed store, hash-verified

11020 return element
11021
11022 def widget_to_element(self, widget):
11023 """
11024 Returns the element that matches a supplied tkinter widget.
11025 If no matching element is found, then None is returned.
11026
11027
11028 :return: Element that uses the specified widget
11029 :rtype: Element | None
11030 """
11031 if self.AllKeysDict is None or len(self.AllKeysDict) == 0:
11032 return None
11033 for key, element in self.AllKeysDict.items():
11034 if element.Widget == widget:
11035 return element
11036 return None
11037
11038 def _BuildKeyDict(self):
11039 """

Callers 2

get_next_focusMethod · 0.80
get_previous_focusMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected