Skip to main content
Window widgets form the foundation of your CustomTkinter application. They provide the top-level containers for all other widgets.

Available Windows

CTk

Main application window - the root container for your app

CTkToplevel

Secondary windows for dialogs and additional screens

CTkInputDialog

Pre-built dialog for collecting simple user input

CTk

The main application window that serves as the root container.
import customtkinter as ctk

app = ctk.CTk()
app.title("My Application")
app.geometry("800x600")

# Add your widgets here

app.mainloop()
Key Features:
  • Root window for your application
  • Supports appearance mode and theming
  • Compatible with all Tkinter geometry managers
  • Automatic DPI scaling
View Full API Reference →

CTkToplevel

Creates additional windows for dialogs, settings panels, or multi-window applications.
def open_settings():
    settings_window = ctk.CTkToplevel(app)
    settings_window.title("Settings")
    settings_window.geometry("400x300")
    
    label = ctk.CTkLabel(settings_window, text="Settings Panel")
    label.pack(pady=20)

button = ctk.CTkButton(app, text="Open Settings", command=open_settings)
button.pack()
Key Features:
  • Independent secondary windows
  • Inherits appearance mode from parent
  • Can be modal or non-modal
  • Supports all standard window operations
View Full API Reference →

CTkInputDialog

A pre-configured dialog window for quickly collecting text input from users.
def get_user_name():
    dialog = ctk.CTkInputDialog(
        text="Enter your name:",
        title="User Information"
    )
    name = dialog.get_input()
    if name:
        print(f"Hello, {name}!")

button = ctk.CTkButton(app, text="Enter Name", command=get_user_name)
button.pack()
Key Features:
  • Simple text input collection
  • Built-in OK/Cancel buttons
  • Returns user input or None if cancelled
  • Automatically themed
View Full API Reference →

Window Management

Appearance Mode

Set the appearance mode for all windows:
ctk.set_appearance_mode("dark")  # "light", "dark", or "system"

Color Theme

Customize the color scheme:
ctk.set_default_color_theme("blue")  # "blue", "green", "dark-blue"

Scaling

Adjust DPI scaling:
ctk.set_widget_scaling(1.5)  # Scale all widgets by 1.5x
ctk.set_window_scaling(1.5)  # Scale window dimensions by 1.5x

Build docs developers (and LLMs) love