-
header: body:
|
Beta Was this translation helpful? Give feedback.
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() |
Beta Was this translation helpful? Give feedback.
Here is an example for the page implementation in ctktable,