-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
Tablesg.Tablesg.Table
Description
import PySimpleGUI as sg
rows, cols = 20000, 10
headings = [f'Column {i:0>2d}' for i in range(cols)]
data = [[f'Data {row:0>5d}/{col:0>2d}' for col in range(cols)] for row in range(rows)]
sg.theme("LightBlue3")
layout = [
[sg.Table(data, headings=headings, num_rows=20, justification='c', key='-TABLE-')],
[sg.Push(), sg.Button("Update"), sg.Push()],
]
window = sg.Window('Title', layout, finalize=True)
table = window['-TABLE-']
widget = table.widget
while True:
event, values = window.read()
if event == sg.WIN_CLOSED:
break
elif event == 'Update':
start, stop = 5, 15
for row in range(start, stop):
widget.item(table.tree_ids[row], values=[f'{row:0>5d}/{col:0>2d} Data' for col in range(cols)])
window['-TABLE-'].update(select_rows=[row for row in range(start, stop)])
window.close()Metadata
Metadata
Assignees
Labels
Tablesg.Tablesg.Table

