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

Method update

PySimpleGUI/PySimpleGUI.py:13018–13046  ·  view source on GitHub ↗

Updates the menu, tooltip or icon :param menu: menu defintion :type menu: ??? :param tooltip: string representing tooltip :type tooltip: ??? :param filename: icon filename :type filename: ??? :param data:

(self, menu=None, tooltip=None, filename=None, data=None, data_base64=None, )

Source from the content-addressed store, hash-verified

13016 self.window.close()
13017
13018 def update(self, menu=None, tooltip=None, filename=None, data=None, data_base64=None, ):
13019 """
13020 Updates the menu, tooltip or icon
13021 :param menu: menu defintion
13022 :type menu: ???
13023 :param tooltip: string representing tooltip
13024 :type tooltip: ???
13025 :param filename: icon filename
13026 :type filename: ???
13027 :param data: icon raw image
13028 :type data: ???
13029 :param data_base64: icon base 64 image
13030 :type data_base64: ???
13031 """
13032 # Menu
13033 if menu is not None:
13034 top_menu = tk.Menu(self.window.TKroot, tearoff=False)
13035 AddMenuItem(top_menu, menu[1], self.window['-IMAGE-'])
13036 self.window['-IMAGE-'].TKRightClickMenu = top_menu
13037
13038 if filename:
13039 self.window['-IMAGE-'].update(filename=filename)
13040 elif data_base64:
13041 self.window['-IMAGE-'].update(data=data_base64)
13042 elif data:
13043 self.window['-IMAGE-'].update(data=data)
13044
13045 if tooltip:
13046 self.window['-IMAGE-'].set_tooltip(tooltip)
13047
13048 @classmethod
13049 def notify(cls, title, message, icon=_tray_icon_success, display_duration_in_ms=SYSTEM_TRAY_MESSAGE_DISPLAY_DURATION_IN_MILLISECONDS,

Callers 1

mainFunction · 0.95

Calls 3

AddMenuItemFunction · 0.85
set_tooltipMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected