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

Function _no_titlebar_setup

PySimpleGUI/PySimpleGUI.py:17761–17785  ·  view source on GitHub ↗

Does the operations required to turn off the titlebar for the window. The Raspberry Pi required the settings to be make after the window's creation. Calling twice seems to have had better overall results so that's what's currently done. The MAC has been the problem with this feature

(window)

Source from the content-addressed store, hash-verified

17759
17760
17761def _no_titlebar_setup(window):
17762 """
17763 Does the operations required to turn off the titlebar for the window.
17764 The Raspberry Pi required the settings to be make after the window's creation.
17765 Calling twice seems to have had better overall results so that's what's currently done.
17766 The MAC has been the problem with this feature. It's been a chronic problem on the Mac.
17767 :param window: window to turn off the titlebar if indicated in the settings
17768 :type window: Window
17769 """
17770 try:
17771 if window.NoTitleBar:
17772 if running_linux():
17773 # window.TKroot.wm_attributes("-type", 'splash')
17774 window.TKroot.wm_attributes("-type", 'dock')
17775 else:
17776 window.TKroot.wm_overrideredirect(True)
17777 # Special case for Mac. Need to clear flag again if not tkinter version 8.6.10+
17778 # Previously restricted patch to only certain tkinter versions. Now use the patch setting exclusively regardless of tk ver
17779 # if running_mac() and ENABLE_MAC_NOTITLEBAR_PATCH and (sum([int(i) for i in tclversion_detailed.split('.')]) < 24):
17780 # if running_mac() and ENABLE_MAC_NOTITLEBAR_PATCH:
17781 if _mac_should_apply_notitlebar_patch():
17782 print('* Applying Mac no_titlebar patch *')
17783 window.TKroot.wm_overrideredirect(False)
17784 except Exception as e:
17785 warnings.warn('** Problem setting no titlebar {} **'.format(e), UserWarning)
17786
17787
17788# ----====----====----====----====----==== STARTUP TK ====----====----====----====----====----#

Callers 2

StartupTKFunction · 0.85
_convert_window_to_tkFunction · 0.85

Calls 2

running_linuxFunction · 0.70

Tested by

no test coverage detected