test_tabview.py 871 B

12345678910111213141516171819202122232425262728293031323334
  1. import customtkinter
  2. app = customtkinter.CTk()
  3. app.geometry("800x900")
  4. tabview_1 = customtkinter.CTkTabview(app)
  5. tabview_1.pack(padx=20, pady=20)
  6. tab_1 = tabview_1.add("tab 1")
  7. tabview_1.insert(0, "tab 2")
  8. tabview_1.add("tab 42")
  9. tabview_1.set("tab 42")
  10. tabview_1.delete("tab 42")
  11. tabview_1.insert(0, "tab 42")
  12. tabview_1.delete("tab 42")
  13. tabview_1.insert(1, "tab 42")
  14. tabview_1.delete("tab 42")
  15. tabview_1.move(0, "tab 2")
  16. b2 = customtkinter.CTkButton(master=tabview_1.tab("tab 2"), text="button tab 2")
  17. b2.pack()
  18. # tabview_1.tab("tab 2").configure(fg_color="red")
  19. tabview_1.configure(state="normal")
  20. # tabview_1.delete("tab 1")
  21. for i in range(10):
  22. for j in range(30):
  23. button = customtkinter.CTkButton(tabview_1.tab("tab 1"), height=10, width=30, font=customtkinter.CTkFont(size=8))
  24. button.grid(row=j, column=i, padx=2, pady=2)
  25. app.mainloop()