forked from TomSchimansky/CustomTkinter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added tests for CTk window behavior when switchng appearance mode and…
… hiding at program start TomSchimansky#66 TomSchimansky#277
- Loading branch information
1 parent
65c45ab
commit 81f3f9a
Showing
4 changed files
with
53 additions
and
25 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
test/manual_integration_tests/test_ctk_window_behavior/test_ctk_appearance_mode_change.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
9 changes: 9 additions & 0 deletions
9
test/manual_integration_tests/test_ctk_window_behavior/test_ctk_iconify_at_beginning.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
9 changes: 9 additions & 0 deletions
9
test/manual_integration_tests/test_ctk_window_behavior/test_ctk_withdraw_at_beginning.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file was deleted.
Oops, something went wrong.