()
| 120 | |
| 121 | |
| 122 | def 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 | |
| 153 | if __name__ == '__main__': |
no test coverage detected