MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / fill_form_with_values

Function fill_form_with_values

PySimpleGUI/PySimpleGUI.py:15142–15158  ·  view source on GitHub ↗

Fills a window with values provided in a values dictionary { element_key : new_value } :param window: The window object to fill :type window: (Window) :param values_dict: A dictionary with element keys as key and value is values parm for Update call :type values_dict

(window, values_dict)

Source from the content-addressed store, hash-verified

15140
15141
15142def fill_form_with_values(window, values_dict):
15143 """
15144 Fills a window with values provided in a values dictionary { element_key : new_value }
15145
15146 :param window: The window object to fill
15147 :type window: (Window)
15148 :param values_dict: A dictionary with element keys as key and value is values parm for Update call
15149 :type values_dict: (Dict[Any, Any])
15150 :return: None
15151 :rtype: None
15152 """
15153
15154 for element_key in values_dict:
15155 try:
15156 window.AllKeysDict[element_key].Update(values_dict[element_key])
15157 except Exception as e:
15158 print('Problem filling form. Perhaps bad key? This is a suspected bad key: {}'.format(element_key))
15159
15160
15161def _FindElementWithFocusInSubForm(form):

Callers

nothing calls this directly

Calls 1

UpdateMethod · 0.80

Tested by

no test coverage detected