beetlebug

ztk::mac::tabbing

Sets how macOS joins a toplevel with other windows as tabs of one window.

Synopsis

ztk::mac::tabbing WINDOW ?-mode MODE? ?-group NAME?

Arguments

Name Type Default Meaning
WINDOW toplevel The toplevel, such as ..
-mode automatic, preferred, disallowed automatic The tabbingMode of the window: automatic follows the setting of the user, preferred opens the window as a tab, and disallowed keeps it out of tabs.
-group text empty The tabbingIdentifier of the window. Only windows of the same group join as tabs.

Each call sets both values. An option that the call leaves out gets its default.

Return value

An empty string.

Errors

Error When
ztk::mac::tabbing is only on macOS A backend other than macOS. The error code is ZTK MAC UNAVAILABLE.
bad mode "X": must be automatic, disallowed, or preferred An unknown mode.
bad option "X": must be -group or -mode An unknown option.
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 No: ZTK MAC UNAVAILABLE
macOS Yes
Linux, Wayland No: ZTK MAC UNAVAILABLE
Linux, X11 No: ZTK MAC UNAVAILABLE
Web No: ZTK MAC UNAVAILABLE
iOS, Android No: ZTK MAC UNAVAILABLE
Headless No: ZTK MAC UNAVAILABLE

Example

if {[ztk::has mac]} {
    toplevel .doc2
    ztk::mac::tabbing . -mode preferred -group docs
    ztk::mac::tabbing .doc2 -mode preferred -group docs
}

See also