beetlebug

ztk::win::jumplist

Sets the tasks of the jump list of the app: the items under "Tasks" in the menu of its taskbar button.

Synopsis

ztk::win::jumplist ?TASK ...?

Arguments

Name Type Default Meaning
TASK dict One task. A task starts this program again with its args. With no task, the command removes the list of the app.
title key of a task The text of the item. Each task needs it.
args key of a task empty The arguments of the program.
description key of a task empty The tooltip of the item.
icon key of a task none A file with the icon of the item.
iconindex key of a task 0 The index of the icon in icon.

ztk::recent adds files to the "Recent" part of the same jump list.

Return value

An empty string.

Errors

Error When
ztk::win::jumplist is only on Windows A backend other than Windows. The error code is ZTK WIN UNAVAILABLE.
the shell refused the jump list The shell did not take the list. The error code is ZTK WIN JUMPLIST.
a task needs a title A task with no title, or an empty one.
bad key "K" of a task: must be args, description, icon, iconindex, or title An unknown key.
a task is a dict of title, args, description, icon, and iconindex A task with an odd count of words.

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]} {
    ztk::win::jumplist {title "New window" args --new} {title "Open recent" args --recent}
}

See also