Skip to content

v2.2.2

Latest

Choose a tag to compare

@israel-dryer israel-dryer released this 17 Aug 12:37
· 1 commit to master since this release
7f3d9ea

A small patch release: one message-dialog fix, plus documentation corrections. No API changes — nothing was removed, and no call that worked in 2.2.1 fails.

Fixed

Message dialogs accept an icon glyph name

MessageDialog(icon=...) and the Messagebox methods now accept a Bootstrap Icons glyph name, which is what the reference pages have always documented the option to be:

Messagebox.okcancel("Ok or Cancel?", "Choose", icon="question-circle-fill")

Previously that warned — "could not be loaded as an image name, base64 data, or file path" — and the dialog opened with no icon at all.

Who notices. Anyone who passed icon= to a message dialog and got nothing. The show_info / show_warning / show_error / show_question defaults were never affected: those render their own glyph internally, and only reached the broken path when a caller overrode icon=.

Why it happened. The option accepted a str, so it type-checked, and ttk.Icon(...) returns a str — an opaque Tk image name like "pyimage24". Four different meanings shared one annotation, and the one form the parameter name advertises was the one that failed. Every other icon= in the library already takes a glyph name (ttk.Button(icon="gear-fill"), ToastNotification(icon="bell-fill")), so the dialogs were the sole exception.

A bare glyph name renders at the same size as the built-in alert glyphs, in the theme foreground — a caller's glyph carries no semantics to map to a color, and guessing one would be wrong as often as right. ttk.Icon("gear-fill", 40, "warning") remains the way to ask for a specific size or color. The forms that already worked (a rendered ttk.Icon(...), a PhotoImage, base64 image data, a file path) are unchanged, and an unusable value still warns and drops the icon rather than failing to open the dialog.

Typing. icon is now annotated str | PhotoImage on MessageDialog and all nine Messagebox methods, where it read str before. A PhotoImage always worked at runtime; only the annotation rejected it, so passing one was a type-checker error in an otherwise correct call.

Documentation

The docs site is now www.ttkbootstrap.org. A custom domain in front of the same Read the Docs build, so every path is unchanged and only the host moved — /en/latest/ and /en/version-1/ both resolve, as does the bare root. Old ttkbootstrap.readthedocs.io links keep working.

The migration guide now describes both halves of the removed ttkbootstrap.icons module. It covered only the Emoji character constants, so a 1.x reader looking for Icon.info / Icon.warning / Icon.error / Icon.question — the four base64 alert images the message dialogs used to draw on — plus the ttkbootstrap logo found nothing about them. It now names both halves, says what replaced each, and shows the two dialog forms.

The MessageDialog and Messagebox reference pages spell out every accepted icon form, rather than the glyph name alone.

Install

pip install --upgrade ttkbootstrap

Full changelog: v2.2.1...v2.2.2