Repository navigation
loading time in a large number of records #89
Answered
by
Akascape
hassan-anari
asked this question in
Q&A
|
header: body:
|
Answered by
Akascape
Apr 17, 2024
Replies: 1 comment
|
Here is an example for the page implementation in ctktable, import customtkinter
from CTkTable import *
def change_left():
global current_page
current_page -= 4 # move 4 rows backward
table.update_values(values[current_page-4:current_page])
pass
def change_right():
global current_page
current_page += 4 # move 4 rows forward
table.update_values(values[current_page-4:current_page])
pass
root = customtkinter.CTk()
current_page = 0
# Make a long list
values = []
start = 0
end = 5
for i in range(20):
values.append(list(range(start, end)))
start = end
end += 5
table = CTkTable(master=root, row=4, column=5)
table.pack(expand=True, fill="both", padx=20, pady=20)
customtkinter.CTkButton(root, text="<", width=40, command=change_left).pack(side="left", expand=True, pady=10)
customtkinter.CTkButton(root, text=">", width=40, command=change_right).pack(side="right", expand=True, pady=10)
change_right()
root.mainloop() |
0 replies
Answer selected by
hassan-anari
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is an example for the page implementation in ctktable,