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

Function main_mac_feature_control

PySimpleGUI/PySimpleGUI.py:23608–23644  ·  view source on GitHub ↗

Window to set settings that will be used across all PySimpleGUI programs that choose to use them. Use set_options to set the path to the folder for all PySimpleGUI settings. :return: True if settings were changed :rtype: (bool)

()

Source from the content-addressed store, hash-verified

23606
23607
23608def main_mac_feature_control():
23609 """
23610 Window to set settings that will be used across all PySimpleGUI programs that choose to use them.
23611 Use set_options to set the path to the folder for all PySimpleGUI settings.
23612
23613 :return: True if settings were changed
23614 :rtype: (bool)
23615 """
23616
23617 current_theme = theme()
23618 theme('dark red')
23619
23620 layout = [[T('Mac PySimpleGUI Feature Control', font='DEFAIULT 18')],
23621 [T('Use this window to enable / disable features.')],
23622 [T('Unfortunately, on some releases of tkinter on the Mac, there are problems that')],
23623 [T('create the need to enable and disable sets of features. This window facilitates the control.')],
23624 [T('Feature Control / Settings', font='_ 16 bold')],
23625 [T('You are running tkinter version:', font='_ 12 bold'), T(framework_version, font='_ 12 bold')]]
23626
23627 for key, value in MAC_PATCH_DICT.items():
23628 layout += [[Checkbox(key, k=value[0], default=pysimplegui_user_settings.get(value[0], value[1]))]]
23629 layout += [[T('Currently the no titlebar patch ' + ('WILL' if _mac_should_apply_notitlebar_patch() else 'WILL NOT') + ' be applied')],
23630 [T('The no titlebar patch will ONLY be applied on tkinter versions < 8.6.10')]]
23631 layout += [[Button('Ok'), Button('Cancel')]]
23632
23633 window = Window('Mac Feature Control', layout, keep_on_top=True, finalize=True)
23634 while True:
23635 event, values = window.read()
23636 if event in ('Cancel', WIN_CLOSED):
23637 break
23638 if event == 'Ok':
23639 for key, value in values.items():
23640 print('setting {} to {}'.format(key, value))
23641 pysimplegui_user_settings.set(key, value)
23642 break
23643 window.close()
23644 theme(current_theme)
23645
23646
23647''&#x27;

Callers 1

Calls 9

readMethod · 0.95
closeMethod · 0.95
themeFunction · 0.85
CheckboxClass · 0.85
ButtonClass · 0.85
WindowClass · 0.85
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected