-
-
Notifications
You must be signed in to change notification settings - Fork 0
CTk Label
Non-interactive text label with formatting and optional icon.
Wraps customtkinter.CTkLabel.
Groups appear in the panel in Content → Layout → Visual → Behavior order.
| Group | Properties |
|---|---|
| Text |
text, font_family, font_size, font_autofit (Auto Fit), Style (bold / italic / underline / strike), justify, Wrap (enabled / wraplength), text_color, text_color_disabled
|
| Icon |
image, image_color, image_color_disabled, image_width / image_height, compound, preserve_aspect
|
| Geometry |
x, y, width, height
|
| Alignment |
anchor, padx, pady
|
| Rectangle | corner_radius |
| Main Colors |
fg_color, bg_color
|
| Interaction |
label_enabled, cursor, takefocus
|
Notable behaviour:
-
Auto Fit derives
font_sizefrom the widget box + text. Toggling off restores the pre-autofit size. -
Wrap falls back to widget width when
wraplengthis0. -
Preserve Aspect locks
image_heightto the icon's native ratio. - Disabled visuals are manual —
label_enabled=Falseswapstext_colortotext_color_disabledand usesimage_color_disabledif set, instead of Tk's native white-wash.
Full schema lives in
app/widgets/ctk_label.py.
CTkLabel routes every binding through both the inner canvas and the Tk Label, so events fire on the rounded corners too.
Default — Click, Double click, Mouse enter, Mouse leave, Mouse wheel.
Advanced (collapsed by default in the Properties panel Events group) — Middle click, Right click, Mouse release, Mouse move, Resize, Shown, Hidden, Focus in, Focus out, Key press, Key release.
Hovering an event row in the Properties panel shows a tooltip describing when it fires and any caveat (<Motion> and <Configure> warn that they fire at 60+ Hz; <FocusIn> / <FocusOut> / <KeyPress> / <KeyRelease> warn that they need takefocus=True).
See Event Handlers for the binding workflow.
See also — Widgets · Image · CustomTkinter docs