2

我有一个大约 9000 行的小型数据库。每次我启动我的程序时,表格都从 1:st 行开始。是否可以以编程方式显示表格的特定部分,例如显示最后记录或显示与例如第 1172 行相邻的记录?/pa

4

2 回答 2

0

您可以使用see小部件的方法,参数是从 0 开始计数的行号。它可能在您显示区域的底线。

...
window = sg.Window('Title', layout, finalized)
window['-TABLE-'].Widget.see(1172)
...
于 2020-12-19T07:15:57.007 回答
0

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)
于 2020-12-18T19:27:37.283 回答