mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
@ -12,7 +12,7 @@ class App(customtkinter.CTk):
|
||||
super().__init__()
|
||||
|
||||
self.title("CustomTkinter complex_example.py")
|
||||
self.geometry(f"{920}x{500}")
|
||||
self.geometry(f"{920}x{500}-100-100")
|
||||
self.protocol("WM_DELETE_WINDOW", self.on_closing) # call .on_closing() when app gets closed
|
||||
|
||||
# configure grid layout (4x4)
|
||||
|
35
test/manual_integration_tests/test_window_geometry.py
Normal file
35
test/manual_integration_tests/test_window_geometry.py
Normal file
@ -0,0 +1,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.mainloop()
|
Reference in New Issue
Block a user