mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
small fixes in examples
This commit is contained in:
parent
cf6f513afc
commit
aa46c56da9
@ -16,7 +16,8 @@ CustomTkinter is a python UI-library based on Tkinter, which provides new, moder
|
||||
fully customizable widgets. They are created and used like normal Tkinter widgets and
|
||||
can also be used in combination with normal Tkinter elements. The widgets
|
||||
and the window colors either adapt to the system appearance or the manually set mode
|
||||
('light', 'dark'). With CustomTkinter you'll get a consistent and modern look across all
|
||||
('light', 'dark'), and all CustomTkinter widgets and windows support HighDPI scaling
|
||||
(Windows, macOS). With CustomTkinter you'll get a consistent and modern look across all
|
||||
desktop platforms (Windows, macOS, Linux).
|
||||
|
||||
|
||||
|
@ -16,7 +16,6 @@ class App(customtkinter.CTk):
|
||||
|
||||
self.title("CustomTkinter complex_example.py")
|
||||
self.geometry(f"{App.WIDTH}x{App.HEIGHT}")
|
||||
|
||||
self.protocol("WM_DELETE_WINDOW", self.on_closing) # call .on_closing() when app gets closed
|
||||
|
||||
# ============ create two frames ============
|
||||
@ -196,10 +195,7 @@ class App(customtkinter.CTk):
|
||||
def on_closing(self, event=0):
|
||||
self.destroy()
|
||||
|
||||
def start(self):
|
||||
self.mainloop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = App()
|
||||
app.start()
|
||||
app.mainloop()
|
||||
|
@ -1,7 +1,7 @@
|
||||
import tkinter
|
||||
import customtkinter
|
||||
|
||||
customtkinter.set_appearance_mode("light") # Modes: "System" (standard), "Dark", "Light"
|
||||
customtkinter.set_appearance_mode("dark") # Modes: "System" (standard), "Dark", "Light"
|
||||
customtkinter.set_default_color_theme("blue") # Themes: "blue" (standard), "green", "dark-blue"
|
||||
|
||||
app = customtkinter.CTk() # create CTk window like you do with the Tk window
|
||||
@ -23,7 +23,7 @@ def check_box_function():
|
||||
|
||||
y_padding = 13
|
||||
|
||||
frame_1 = customtkinter.CTkFrame(master=app, corner_radius=15)
|
||||
frame_1 = customtkinter.CTkFrame(master=app)
|
||||
frame_1.pack(pady=20, padx=60, fill="both", expand=True)
|
||||
|
||||
label_1 = customtkinter.CTkLabel(master=frame_1, justify=tkinter.LEFT)
|
||||
@ -32,7 +32,7 @@ label_1.pack(pady=y_padding, padx=10)
|
||||
progressbar_1 = customtkinter.CTkProgressBar(master=frame_1)
|
||||
progressbar_1.pack(pady=y_padding, padx=10)
|
||||
|
||||
button_1 = customtkinter.CTkButton(master=frame_1, corner_radius=8, command=button_function)
|
||||
button_1 = customtkinter.CTkButton(master=frame_1, command=button_function)
|
||||
button_1.pack(pady=y_padding, padx=10)
|
||||
|
||||
slider_1 = customtkinter.CTkSlider(master=frame_1, command=slider_function, from_=0, to=1)
|
||||
@ -42,9 +42,6 @@ slider_1.set(0.5)
|
||||
entry_1 = customtkinter.CTkEntry(master=frame_1, placeholder_text="CTkEntry")
|
||||
entry_1.pack(pady=y_padding, padx=10)
|
||||
|
||||
optionmenu_1 = customtkinter.CTkOptionMenu(master=frame_1, values=["Option 1", "Option 2", "Option 3"])
|
||||
optionmenu_1.pack(pady=y_padding, padx=10)
|
||||
|
||||
checkbox_1 = customtkinter.CTkCheckBox(master=frame_1, command=check_box_function)
|
||||
checkbox_1.pack(pady=y_padding, padx=10)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user