enhanced geometry test

This commit is contained in:
TomSchimansky 2022-09-15 13:54:32 +02:00
parent d2f8fd012f
commit 423d0886c9

View File

@ -3,33 +3,35 @@ import customtkinter
customtkinter.set_window_scaling(1.3)
app = customtkinter.CTk()
app.geometry("300x300")
app.geometry("-100-100")
app.geometry("+-100+-100")
app.geometry("+100+100")
app.geometry("300x300-100-100")
app.geometry("300x300+-100+-100")
app.geometry("300x300+100+100")
app.geometry("400x400")
app.geometry("+400+400")
app.update()
print(app.geometry())
assert app.geometry() == "400x400+400+400"
toplevel = customtkinter.CTkToplevel(app)
toplevel.geometry("300x300")
toplevel.geometry("-100-100")
toplevel.geometry("+-100+-100")
toplevel.geometry("+100+100")
toplevel.geometry("300x300-100-100")
toplevel.geometry("300x300+-100+-100")
toplevel.geometry("300x300+100+100")
toplevel.geometry("300x300")
toplevel.geometry("+500+500")
toplevel.update()
print(toplevel.geometry())
assert toplevel.geometry() == "300x300+500+500"
app.after(1000, lambda: app.geometry("300x300"))
app.after(2000, lambda: app.geometry("-100-100"))
app.after(3000, lambda: app.geometry("+-100+-100"))
app.after(4000, lambda: app.geometry("+100+100"))
app.after(5000, lambda: app.geometry("300x300-100-100"))
app.after(6000, lambda: app.geometry("300x300+-100+-100"))
app.after(7000, lambda: app.geometry("300x300+100+100"))
app.after(8000, lambda: app.geometry("400x400"))
app.after(9000, lambda: app.geometry("+400+400"))
app.after(10000, lambda: toplevel.geometry("300x300"))
app.after(11000, lambda: toplevel.geometry("-100-100"))
app.after(12000, lambda: toplevel.geometry("+-100+-100"))
app.after(13000, lambda: toplevel.geometry("+100+100"))
app.after(14000, lambda: toplevel.geometry("300x300-100-100"))
app.after(15000, lambda: toplevel.geometry("300x300+-100+-100"))
app.after(16000, lambda: toplevel.geometry("300x300+100+100"))
app.after(17000, lambda: toplevel.geometry("300x300"))
app.after(18000, lambda: toplevel.geometry("+500+500"))
app.after(19000, lambda: print("app:", app.geometry()))
app.after(19000, lambda: print("toplevel:", toplevel.geometry()))
app.mainloop()