beetlebug

ztk::win::thumbbar

Sets the buttons under the thumbnail of the taskbar button of a toplevel.

Synopsis

ztk::win::thumbbar WINDOW ?BUTTON ...?

Arguments

Name Type Default Meaning
WINDOW toplevel The toplevel, such as ..
BUTTON dict One button, at most 7. With no button, the thumbnail has no buttons.
image key of a button none A photo image for the button.
tooltip key of a button empty The text that the system shows when the pointer stays on the button.
command key of a button empty Runs at the global level at a click.
disabled key of a button 0 1 dims the button, and it ignores clicks.

Return value

An empty string.

Errors

Error When
ztk::win::thumbbar is only on Windows A backend other than Windows. The error code is ZTK WIN UNAVAILABLE.
a thumbnail has at most 7 buttons More than 7 buttons.
bad key "K" of a button: must be command, disabled, image, or tooltip An unknown key.
a button is a dict of image, tooltip, command, and disabled A button with an odd count of words.
image "NAME" doesn't exist image names no photo.
expected boolean value but got "X" A bad value of disabled.
bad window path name "W", "W" is not a toplevel, "W" has no window WINDOW is not a toplevel with a platform window.

Platforms

Platform Works
Windows Yes
macOS No: ZTK WIN UNAVAILABLE
Linux, Wayland No: ZTK WIN UNAVAILABLE
Linux, X11 No: ZTK WIN UNAVAILABLE
Web No: ZTK WIN UNAVAILABLE
iOS, Android No: ZTK WIN UNAVAILABLE
Headless No: ZTK WIN UNAVAILABLE

Example

if {[ztk::has win]} {
    image create photo play -width 16 -height 16
    play put #2c7be5 -to 3 3 13 13
    ztk::win::thumbbar . [list image play tooltip Play command {puts play}]
}

See also