Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/TomSchimansky/CustomTkinter/llms.txt

Use this file to discover all available pages before exploring further.

Input widgets enable user interaction through various control types including text entry, checkboxes, sliders, and selection menus.

Available Widgets

CTkEntry

Single-line text input field

CTkCheckBox

Toggle checkbox for binary choices

CTkRadioButton

Radio button for mutually exclusive selections

CTkSwitch

Toggle switch for on/off states

CTkSlider

Slider for selecting values from a range

CTkOptionMenu

Dropdown menu for selecting from options

CTkComboBox

Editable dropdown with autocomplete

CTkSegmentedButton

Multi-option segmented control

CTkEntry

Single-line text input field for collecting user text.
entry = ctk.CTkEntry(
    app,
    placeholder_text="Enter your name",
    width=200
)
entry.pack(pady=10)

# Get the value
value = entry.get()
View Full API Reference →

CTkCheckBox

Checkbox for binary choices or multiple selections.
checkbox_var = ctk.BooleanVar(value=True)

checkbox = ctk.CTkCheckBox(
    app,
    text="Accept Terms",
    variable=checkbox_var
)
checkbox.pack(pady=10)
View Full API Reference →

CTkRadioButton

Radio button for selecting one option from a group.
radio_var = ctk.StringVar(value="option1")

radio1 = ctk.CTkRadioButton(app, text="Option 1", variable=radio_var, value="option1")
radio1.pack(pady=5)

radio2 = ctk.CTkRadioButton(app, text="Option 2", variable=radio_var, value="option2")
radio2.pack(pady=5)
View Full API Reference →

CTkSwitch

Toggle switch for on/off states with a modern appearance.
switch_var = ctk.BooleanVar()

switch = ctk.CTkSwitch(
    app,
    text="Enable Notifications",
    variable=switch_var
)
switch.pack(pady=10)
View Full API Reference →

CTkSlider

Slider for selecting numeric values from a continuous range.
def slider_callback(value):
    label.configure(text=f"Value: {int(value)}")

slider = ctk.CTkSlider(
    app,
    from_=0,
    to=100,
    command=slider_callback
)
slider.pack(pady=10)

label = ctk.CTkLabel(app, text="Value: 50")
label.pack()
View Full API Reference →

CTkOptionMenu

Dropdown menu for selecting one option from a list.
def optionmenu_callback(choice):
    print(f"Selected: {choice}")

optionmenu = ctk.CTkOptionMenu(
    app,
    values=["Option 1", "Option 2", "Option 3"],
    command=optionmenu_callback
)
optionmenu.pack(pady=10)
View Full API Reference →

CTkComboBox

Editable dropdown with autocomplete functionality.
combobox = ctk.CTkComboBox(
    app,
    values=["Python", "JavaScript", "Java", "C++"],
    state="readonly"  # or "normal" for editable
)
combobox.pack(pady=10)

# Get selected value
value = combobox.get()
View Full API Reference →

CTkSegmentedButton

Segmented control for selecting one option from multiple choices.
def segmented_callback(value):
    print(f"Selected segment: {value}")

segmented = ctk.CTkSegmentedButton(
    app,
    values=["Day", "Week", "Month", "Year"],
    command=segmented_callback
)
segmented.pack(pady=10)
segmented.set("Week")  # Set default selection
View Full API Reference →

Form Example

Combining input widgets to create a complete form:
form_frame = ctk.CTkFrame(app)
form_frame.pack(pady=20, padx=20, fill="both", expand=True)

# Name
ctk.CTkLabel(form_frame, text="Name:").grid(row=0, column=0, pady=5, padx=10, sticky="w")
name_entry = ctk.CTkEntry(form_frame, width=200)
name_entry.grid(row=0, column=1, pady=5, padx=10)

# Email
ctk.CTkLabel(form_frame, text="Email:").grid(row=1, column=0, pady=5, padx=10, sticky="w")
email_entry = ctk.CTkEntry(form_frame, width=200)
email_entry.grid(row=1, column=1, pady=5, padx=10)

# Country
ctk.CTkLabel(form_frame, text="Country:").grid(row=2, column=0, pady=5, padx=10, sticky="w")
country_menu = ctk.CTkOptionMenu(form_frame, values=["USA", "UK", "Canada"])
country_menu.grid(row=2, column=1, pady=5, padx=10)

# Subscribe
subscribe_var = ctk.BooleanVar()
subscribe = ctk.CTkCheckBox(form_frame, text="Subscribe to newsletter", variable=subscribe_var)
subscribe.grid(row=3, column=1, pady=10, padx=10, sticky="w")

# Submit
submit_btn = ctk.CTkButton(form_frame, text="Submit")
submit_btn.grid(row=4, column=1, pady=10, padx=10)