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

Function minimize_main_window

DemoPrograms/Demo_Titlebar_Custom_Async.py:33–46  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

31
32
33def 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
49def restore_main_window(main_window):

Callers 1

mainFunction · 0.85

Calls 3

minimizeMethod · 0.95
bindMethod · 0.95
hideMethod · 0.45

Tested by

no test coverage detected