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

Method settings_restore

PySimpleGUI/PySimpleGUI.py:11163–11177  ·  view source on GitHub ↗

Reads settings and sets the window's Elements to those values. TODO - NOTE - may have trouble on some elements due to how update calls work

(self)

Source from the content-addressed store, hash-verified

11161 _error_popup_with_traceback('Error saving settings', e)
11162
11163 def settings_restore(self):
11164 """
11165 Reads settings and sets the window's Elements to those values.
11166
11167 TODO - NOTE - may have trouble on some elements due to how update calls work
11168
11169 """
11170 for key in self.key_dict.keys():
11171 try:
11172 element = self.find_element(key)
11173 if element.setting is not None:
11174 value = user_settings_get_entry(key, '')
11175 element.update(value)
11176 except Exception as e:
11177 _error_popup_with_traceback('Error restoring settings', e)
11178
11179
11180 def save_to_disk(self, filename):

Callers

nothing calls this directly

Calls 4

find_elementMethod · 0.95
user_settings_get_entryFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected