Creates an icon on the taskbar that represents your custom titlebar window. The FocusIn event is set so that if the user restores the window from the taskbar. If this window is closed by right clicking on the icon and choosing close, then the program will exit just as if the "X" was
(main_window)
| 31 | |
| 32 | |
| 33 | def minimize_main_window(main_window): |
| 34 | """ |
| 35 | Creates an icon on the taskbar that represents your custom titlebar window. |
| 36 | The FocusIn event is set so that if the user restores the window from the taskbar. |
| 37 | If this window is closed by right clicking on the icon and choosing close, then the |
| 38 | program will exit just as if the "X" was clicked on the main window. |
| 39 | """ |
| 40 | main_window.hide() |
| 41 | layout = [[sg.T('This is your window with a customized titlebar... you just cannot see it')]] |
| 42 | window = sg.Window(main_window.Title, layout, finalize=True, alpha_channel=0) |
| 43 | window.minimize() |
| 44 | window.bind('<FocusIn>', '-RESTORE-') |
| 45 | # store the dummy window as a function property |
| 46 | minimize_main_window.dummy_window = window |
| 47 | |
| 48 | |
| 49 | def restore_main_window(main_window): |