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

Function main

DemoPrograms/Demo_Titlebar_Custom_Multiple_Combinations.py:122–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

120
121
122def main():
123 theme, color_pairs = choose_theme()
124
125 index = 0
126 window = create_window('{} - {}'.format(color_pairs[index][0],theme), color_pairs[index][1], color_pairs[index][2])
127
128 while True: # Event Loop
129 event, values = window.read()
130 print(event, values)
131 if event == sg.WIN_CLOSED or event.startswith('Exit'):
132 break
133 if event == '-MINIMIZE-':
134 window.hide()
135 dummy_minimized_window(window.Title)
136 window.un_hide()
137 window.force_focus()
138 elif event == 'Go':
139 window['-OUT-'].update(values['-IN-'])
140 elif event == 'Next':
141 window.close()
142 index = (index + 1) % len(color_pairs)
143 window = create_window('{} - {}'.format(color_pairs[index][0],theme), color_pairs[index][1], color_pairs[index][2])
144 elif event == 'New Theme':
145 window.close()
146 theme, color_pairs = choose_theme()
147 index = 0
148 window = create_window('{} - {}'.format(color_pairs[index][0],theme), color_pairs[index][1], color_pairs[index][2])
149
150 window.close()
151
152
153if __name__ == '__main__':

Calls 9

force_focusMethod · 0.80
choose_themeFunction · 0.70
create_windowFunction · 0.70
dummy_minimized_windowFunction · 0.70
readMethod · 0.45
hideMethod · 0.45
un_hideMethod · 0.45
updateMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected