pysimplegui, show selected part of a table

Viewed 851

I have a small database with ~9000 rows. Every time I start my program the table starts with the 1:st row. Is it possible to programatically show a specific part of the table, like show last records or show records adjacent to for examle row 1172? /p-a

2 Answers

You can hide the rows you do not want to show ('iid' is a unique identifier of the row assigned when you add the row to the table:

tkTable = window['~TABLE~'].Widget

new_row = 'some text'
tkTable.insert('', 'end', iid=id, text='some text', values=new_row)

tkTable.detach(iid)

You can use method see of widget, arguments is the row number which count from 0. It maybe on the bottom line in your shown area.

...
window = sg.Window('Title', layout, finalized)
window['-TABLE-'].Widget.see(1172)
...
Related