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

Function main

DemoPrograms/Demo_Layout_Add_and_Delete_Rows.py:46–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44
45
46def main():
47
48 window = make_window()
49 while True:
50 event, values = window.read() # wake every hour
51 print(event, values)
52 if event == sg.WIN_CLOSED or event == 'Exit':
53 break
54 if event == 'Add Item':
55 window.metadata += 1
56 window.extend_layout(window['-TRACKING SECTION-'], [item_row(window.metadata)])
57 elif event == 'Edit Me':
58 sg.execute_editor(__file__)
59 elif event == 'Version':
60 sg.popup_scrolled(__file__, sg.get_versions(), location=window.current_location(), keep_on_top=True, non_blocking=True)
61 elif event[0] == '-DEL-':
62 window[('-ROW-', event[1])].update(visible=False)
63 window.close()
64
65
66if __name__ == '__main__':

Calls 7

item_rowFunction · 0.85
extend_layoutMethod · 0.80
current_locationMethod · 0.80
make_windowFunction · 0.70
readMethod · 0.45
updateMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected