CustomTkinter

5.2.2 · active · verified Sun Apr 12

CustomTkinter is a Python UI library based on Tkinter, designed to create modern-looking and fully customizable graphical user interfaces. It provides a consistent and aesthetically pleasing experience across Windows, macOS, and Linux platforms, enhancing standard Tkinter widgets with advanced styling. The library is actively developed, with its current version being 5.2.2.

Warnings

Install

Imports

Quickstart

This quickstart initializes a basic CustomTkinter window, sets the appearance mode and color theme, and adds a centered button that prints a message when clicked.

import customtkinter

customtkinter.set_appearance_mode("System")  # Modes: "System" (default), "Dark", "Light"
customtkinter.set_default_color_theme("blue")  # Themes: "blue" (default), "dark-blue", "green"

app = customtkinter.CTk() # create CTk window
app.geometry("400x240")
app.title("My CTk App")

def button_function():
    print("Button pressed!")

# Create a button
button = customtkinter.CTkButton(master=app, text="Click Me", command=button_function)
button.place(relx=0.5, rely=0.5, anchor=customtkinter.CENTER)

app.mainloop()

view raw JSON →