test_configure_dimensions.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import customtkinter
  2. import random
  3. app = customtkinter.CTk()
  4. app.geometry("400x400")
  5. def button_callback():
  6. button_1.configure(width=random.randint(30, 200), height=random.randint(30, 60))
  7. frame_1.configure(width=random.randint(30, 200), height=random.randint(30, 200))
  8. label_1.configure(width=random.randint(30, 200), height=random.randint(30, 40))
  9. entry_1.configure(width=random.randint(30, 200), height=random.randint(30, 40))
  10. progressbar_1.configure(width=random.randint(30, 200), height=random.randint(10, 16))
  11. slider_1.configure(width=random.randint(30, 200), height=random.randint(14, 20))
  12. button_1 = customtkinter.CTkButton(app, text="button_1", command=button_callback)
  13. button_1.pack(pady=10)
  14. frame_1 = customtkinter.CTkFrame(app)
  15. frame_1.pack(pady=10)
  16. label_1 = customtkinter.CTkLabel(app, fg_color="green")
  17. label_1.pack(pady=10)
  18. entry_1 = customtkinter.CTkEntry(app, placeholder_text="placeholder")
  19. entry_1.pack(pady=10)
  20. progressbar_1 = customtkinter.CTkProgressBar(app)
  21. progressbar_1.pack(pady=10)
  22. slider_1 = customtkinter.CTkSlider(app)
  23. slider_1.pack(pady=10)
  24. app.mainloop()