User Guide#
Learn ttkbootstrap by working through it: set up and build your first window,
grasp the core styling concepts (the bootstyle grammar and how styling is
delivered), reach for a feature guide when you need a whole subsystem — fonts,
localization, validation, windowing — or grab a how-to when you have a specific
task in mind. For the complete lookup of every public name see the
Reference; for the visual widget catalog see
Widgets.
Getting Started#
Install from PyPI; supported Python versions.
Your first themed window; App vs Tk; choosing a theme.
A guided, end-to-end tutorial: a contact book with a form, validation, and a data table.
App vs Tk, the single-root rule, and a real app skeleton.
bootstyle strings, theme names, removed shims, and icons.
Foundations#
New to tkinter? These pages cover the mental models everything else builds on — how an app runs, how widgets are arranged, how they bind to your data, how they respond to input, and how ttkbootstrap styles them.
The event loop, mainloop, callbacks, after, and not freezing the UI.
The widget tree, options (configure/cget), and ttk states.
The Tcl/Tk layer underneath — path names, dashed options, and how to read
a TclError.
Why a label empties or an image vanishes — keeping variables, images, and fonts alive.
The three geometry managers and when to use each — start here, then the grid and pack tutorials.
Binding widgets to StringVar/IntVar/BooleanVar and reacting to
changes.
command, bind and event objects, virtual events, and after.
The canonical grammar for styling any widget, with the full reference table.
How the bootstyle API reaches your widgets — the widget subclasses,
enable_global_api, bootify, and apply_bootstyle.
Feature guides#
Each subsystem, end to end — its concepts and its usage in one place.
Fonts and set_global_family over the standard named fonts.
L(), LocaleVar, set_locale, and live language switching.
add_*_validation helpers and the @validator decorator.
Variable types, traces (read/write/unset), computed fields, and
LocaleVar.
The binding system in depth — scope & bindtags, stopping events, and dispatching your own virtual events.
Theme-aware Bootstrap Icons glyphs — the icon= keyword, apply_icon,
and the standalone Icon image.
App/Toplevel setup, focus & modality, positioning, high-DPI, and the
deferred-config seam.
Menu bars, submenus, stateful items, context menus, and the cross-platform macOS application menu.
Messagebox and Querybox, the date/font/color pickers, filedialog,
and what each returns.
Choosing and switching themes, light/dark, the built-in catalog, reading
the theme’s colors (style.colors, ramps), and building your own theme.
The custom style-construction toolkit — assets, layouts, and icons.
How-To#
Task-focused recipes — common tkinter jobs done the ttkbootstrap way.
PhotoImage and Pillow, the keep-a-reference gotcha, and themed glyphs.
ScrolledFrame and ScrolledText for content that outgrows the window.
A second Toplevel, a modal that returns a value, and the close button.
after and worker threads, updating widgets safely from the main loop.
The clipboard methods, the copy shortcut, and the current selection.
Take over report_callback_exception and deal with TclError.
A system beep to flag a rejected action or a finished job.
A wait cursor and a block on clicks while a slow job runs.
Frame-by-frame animation with PhotoImage and after.
A borderless startup window that hands off to the main one.
The titlebar and taskbar icon, and the Windows .ico case.