|
| 1 | +from tokenize import Double |
| 2 | +import customtkinter |
| 3 | + |
| 4 | + |
| 5 | +# |
| 6 | +app = customtkinter.CTk() |
| 7 | + |
| 8 | +def DefaultCALLBACK(): |
| 9 | + print("button was clicked") |
| 10 | +def Main_Window(Title, Size1, Size2): |
| 11 | + app.title(f"{Title}") |
| 12 | + app.geometry(f"{Size1}x{Size2}") |
| 13 | + |
| 14 | +def Main_Window_Scaled(Title: str, Size: float): |
| 15 | + app.title(f"{Title}") |
| 16 | + customtkinter.set_window_scaling(Size) |
| 17 | + |
| 18 | +def LightSwitch(Switch: bool): |
| 19 | + if Switch == True: |
| 20 | + customtkinter.set_appearance_mode("light") |
| 21 | + elif Switch == False: |
| 22 | + customtkinter.set_appearance_mode("dark") |
| 23 | + if Switch == None: |
| 24 | + customtkinter.set_appearance_mode("system") |
| 25 | + |
| 26 | +def Theme(Color): |
| 27 | + if Color == "blue".strip(): |
| 28 | + customtkinter.set_default_color_theme("blue") |
| 29 | + elif Color == "green".strip(): |
| 30 | + customtkinter.set_default_color_theme("green") |
| 31 | + elif Color == "dark-blue".strip() or "darkblue".strip(): |
| 32 | + customtkinter.set_default_color_theme("dark-blue") |
| 33 | + |
| 34 | +def Custom_Theme(path): |
| 35 | + customtkinter.set_default_color_theme(path) |
| 36 | +def New_Button(button_text, button_row, button_column, button_paddx, button_paddy, callback): |
| 37 | + New_button_Holder = customtkinter.CTkButton(app, text=button_text, command=callback) |
| 38 | + New_button_Holder.grid(row=button_row, column=button_column, padx=button_paddx, pady=button_paddy) |
| 39 | + |
| 40 | +def New_CheckBox(Box_identity, Box_Text: str, Box_Row: int, Box_column: int, Box_Paddx: int, Box_paddy, *Box_Sticky: str, **Box_StickyCustom: bool): |
| 41 | + if Box_StickyCustom == True: |
| 42 | + Box_identity = customtkinter.CTkCheckBox(app, text=Box_Text) |
| 43 | + Box_identity.grid(row=Box_Row, column=Box_column, padx=Box_Paddx, pady=Box_paddy, sticky="w") #Default Sticky in docs |
| 44 | + elif Box_StickyCustom == False: |
| 45 | + Box_identity = customtkinter.CTkCheckBox(app, text=Box_Text) |
| 46 | + Box_identity.grid(row=Box_Row, column=Box_column, padx=Box_Paddx, pady=Box_paddy, sticky=f"{Box_Sticky}") # Custom Sticky (have yet to find out what sticky does august 26 2025) |
| 47 | + |
| 48 | +def New_CheckBoxFrame(): |
| 49 | + pass |
| 50 | + |
| 51 | +def New_TextBox(): |
| 52 | + customtkinter.CTkTextbox(app) |
| 53 | + |
| 54 | +def TextboxInsert(line, message): |
| 55 | + pass |
| 56 | + |
| 57 | + |
| 58 | + |
0 commit comments