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

Function main

DemoPrograms/Demo_Notify_Integration.py:63–83  ·  view source on GitHub ↗

A little test application that demonstrates calling the notify_popout function

()

Source from the content-addressed store, hash-verified

61
62
63def main():
64 """
65 A little test application that demonstrates calling the notify_popout function
66 """
67
68 layout = [ [sg.Text('My Window')],
69 [sg.T('Notification message:'), sg.Input(key='-IN-')],
70 [sg.B('Show Notification', bind_return_key=True), sg.Button('Exit')] ]
71
72 window = sg.Window('My PySimpleGUI Application', layout)
73
74 while True: # Event Loop
75 event, values = window.read()
76 if event == sg.WIN_CLOSED or event == 'Exit':
77 break
78 if event == 'Show Notification':
79 notify_popout(title=window.Title, message=values['-IN-'], app_name=window.Title)
80
81 window.close()
82 # enjoy the anti-pattern that cleans up the temp files
83 [os.remove(file) for file in notify_popout.temp_files] if hasattr(notify_popout, 'temp_files') else None
84
85
86if __name__ == '__main__':

Callers 1

Calls 4

readMethod · 0.95
closeMethod · 0.95
notify_popoutFunction · 0.85
removeMethod · 0.80

Tested by

no test coverage detected