beetlebug

ztk::has

Gives 1 when the program has a platform feature on this backend, and 0 when it does not.

Synopsis

ztk::has FEATURE

Arguments

Name Type Default Meaning
drag-out feature ztk::dnd drag starts a drag of the system, so a drag can go to other apps.
tray feature ztk::tray create can show an icon.
taskbar feature ztk::taskbar reaches the taskbar button or the Dock icon of the app.
recent feature ztk::recent reaches the recent documents of the system.
native-menus feature Menus show as menus of the system.
mac feature The ztk::mac:: commands work: dockmenu and tabbing.
win feature The ztk::win:: commands work: backdrop, fileassoc, jumplist, and thumbbar.

Return value

1 or 0.

Errors

Error When
bad feature "NAME": must be drag-out, mac, native-menus, recent, taskbar, tray, or win An unknown feature.
wrong # args: should be "ztk::has feature" No feature, or more than one.

Platforms

Platform Works
Windows Yes: 1 for drag-out, tray, taskbar, recent, native-menus, win
macOS Yes: 1 for drag-out, tray, taskbar, native-menus, mac
Linux, Wayland Yes: 1 for drag-out and tray. With no session bus, ztk::tray create fails.
Linux, X11 Yes: 0 for each feature
Web Yes: 0 for each feature
iOS, Android Yes: 0 for each feature
Headless Yes: 1 for tray, taskbar, recent

Example

foreach f {drag-out tray taskbar recent native-menus mac win} {
    puts "$f: [ztk::has $f]"
}

See also