Skip to content

Commit

Permalink
added tests for CTk window behavior when switchng appearance mode and…
Browse files Browse the repository at this point in the history
… hiding at program start TomSchimansky#66 TomSchimansky#277
  • Loading branch information
TomSchimansky committed Sep 15, 2022
1 parent 65c45ab commit 81f3f9a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import customtkinter
import sys

customtkinter.set_appearance_mode("dark")


app = customtkinter.CTk()
app.geometry("400x240")

app.withdraw()
app.after(2000, app.deiconify)


def change_appearance_mode():
# test appearance mode change while withdrawn
app.after(500, app.withdraw)
app.after(1500, lambda: customtkinter.set_appearance_mode("light"))
app.after(2500, app.deiconify)

# test appearance mode change while iconified
app.after(3500, app.iconify)
app.after(4500, lambda: customtkinter.set_appearance_mode("dark"))
app.after(5500, app.deiconify)

if sys.platform.startswith("win"):
# test appearance mode change while zoomed
app.after(6500, lambda: app.state("zoomed"))
app.after(7500, lambda: customtkinter.set_appearance_mode("light"))
app.after(8500, lambda: app.state("normal"))


button_1 = customtkinter.CTkButton(app, text="start test", command=change_appearance_mode)
button_1.pack(pady=20, padx=20)

app.mainloop()
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import customtkinter

app = customtkinter.CTk()
app.geometry("400x240")

app.iconify()
app.after(2000, app.deiconify)

app.mainloop()
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import customtkinter

app = customtkinter.CTk()
app.geometry("400x240")

app.withdraw()
app.after(2000, app.deiconify)

app.mainloop()
25 changes: 0 additions & 25 deletions test/manual_integration_tests/test_iconify_destroy.py

This file was deleted.

0 comments on commit 81f3f9a

Please sign in to comment.