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

Method _pack_forget_save_settings

PySimpleGUI/PySimpleGUI.py:1899–1918  ·  view source on GitHub ↗

Performs a pack_forget which will make a widget invisible. This method saves the pack settings so that they can be restored if the element is made visible again :param alternate_widget: Widget to use that's different than the one defined in Element.Widget. These are usual

(self, alternate_widget=None)

Source from the content-addressed store, hash-verified

1897 return grab
1898
1899 def _pack_forget_save_settings(self, alternate_widget=None):
1900 """
1901 Performs a pack_forget which will make a widget invisible.
1902 This method saves the pack settings so that they can be restored if the element is made visible again
1903
1904 :param alternate_widget: Widget to use that's different than the one defined in Element.Widget. These are usually Frame widgets
1905 :type alternate_widget: (tk.Widget)
1906 """
1907
1908 if alternate_widget is not None and self.Widget is None:
1909 return
1910
1911 widget = alternate_widget if alternate_widget is not None else self.Widget
1912 # if the widget is already invisible (i.e. not packed) then will get an error
1913 try:
1914 pack_settings = widget.pack_info()
1915 self.pack_settings = pack_settings
1916 widget.pack_forget()
1917 except:
1918 pass
1919
1920 def _pack_restore_settings(self, alternate_widget=None):
1921 """

Callers 15

updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected