A little test application that demonstrates calling the notify_popout function
()
| 61 | |
| 62 | |
| 63 | def 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 | |
| 86 | if __name__ == '__main__': |
no test coverage detected