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

Function settings

DemoPrograms/Demo_Desktop_Widget_Launcher_Bar.py:33–49  ·  view source on GitHub ↗
(window:sg.Window)

Source from the content-addressed store, hash-verified

31DEFAULT_BUTTON_SIZE = (None, None)
32
33def settings(window:sg.Window):
34 layout = [[sg.T(f'Screen size = {sg.Window.get_screen_size()}')],
35 [sg.T(f'Your launcher is currently located at {window.current_location()}')],
36 [sg.T('Enable autosave and position your window where you want it to appear next time you run.')],
37 [sg.T('Your Screen Background Color'), sg.In(sg.user_settings_get_entry('-screen color-', DEFAULT_SCREEN_BACKGROUND_COLOR), s=15,k='-SCREEN COLOR-')],
38 [sg.CBox('Autosave Location on Exit', default=sg.user_settings_get_entry('-auto save location-', True), k='-AUTO SAVE LOCATION-')],
39 [sg.CBox('Keep launcher on top', default=sg.user_settings_get_entry('-keep on top-', True), k='-KEEP ON TOP-')],
40 [sg.OK(), sg.Cancel()]]
41 event, values = sg.Window('Settings', layout).read(close=True)
42 if event == 'OK':
43 sg.user_settings_set_entry('-auto save location-', values['-AUTO SAVE LOCATION-'])
44 sg.user_settings_set_entry('-keep on top-', values['-KEEP ON TOP-'])
45 sg.user_settings_set_entry('-screen color-', values['-SCREEN COLOR-'])
46 if values['-KEEP ON TOP-']:
47 window.keep_on_top_set()
48 else:
49 window.keep_on_top_clear()
50
51
52def make_window():

Callers 1

mainFunction · 0.85

Calls 5

get_screen_sizeMethod · 0.80
current_locationMethod · 0.80
keep_on_top_setMethod · 0.80
keep_on_top_clearMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected