test_window_geometry.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import customtkinter
  2. customtkinter.set_window_scaling(1.3)
  3. app = customtkinter.CTk()
  4. toplevel = customtkinter.CTkToplevel(app)
  5. app.after(1000, lambda: app.geometry("300x300"))
  6. app.after(2000, lambda: app.geometry("-100-100"))
  7. app.after(3000, lambda: app.geometry("+-100+-100"))
  8. app.after(4000, lambda: app.geometry("+100+100"))
  9. app.after(5000, lambda: app.geometry("300x300-100-100"))
  10. app.after(6000, lambda: app.geometry("300x300+-100+-100"))
  11. app.after(7000, lambda: app.geometry("300x300+100+100"))
  12. app.after(8000, lambda: app.geometry("400x400"))
  13. app.after(9000, lambda: app.geometry("+400+400"))
  14. app.after(10000, lambda: toplevel.geometry("300x300"))
  15. app.after(11000, lambda: toplevel.geometry("-100-100"))
  16. app.after(12000, lambda: toplevel.geometry("+-100+-100"))
  17. app.after(13000, lambda: toplevel.geometry("+100+100"))
  18. app.after(14000, lambda: toplevel.geometry("300x300-100-100"))
  19. app.after(15000, lambda: toplevel.geometry("300x300+-100+-100"))
  20. app.after(16000, lambda: toplevel.geometry("300x300+100+100"))
  21. app.after(17000, lambda: toplevel.geometry("300x300"))
  22. app.after(18000, lambda: toplevel.geometry("+500+500"))
  23. app.after(19000, lambda: print("app:", app.geometry()))
  24. app.after(19000, lambda: print("toplevel:", toplevel.geometry()))
  25. app.mainloop()