There are optional keys to create platform-specific GUIs without needing separate JSON files for each platform.
You can use optional keys to override commands based on the operating system:
command_win
for Windowscommand_mac
for macOScommand_linux
for Linux (and other unix variants)
Tuw will use the platform-specific command instead of the default command
value.
{
"command_win": "echo Windows!",
"command_mac": "echo macOS!",
"command_linux": "echo Linux!",
"show_last_line": true,
"components": []
}
You can specify the operating systems on which each component should be active using the platforms
key:
win
for Windowsmac
for macOSlinux
for Linux (and other unix variants)
Tuw will ignore the component if the current OS does not match the specified platform(s).
{
"command": "echo %os%",
"show_last_line": true,
"components": [
{
"type": "check",
"label": "Windows!",
"id": "os",
"default": true,
"platforms": "win"
},
{
"type": "check",
"label": "Not Windows!",
"id": "os",
"default": true,
"platforms": [ "mac", "linux" ]
}
]
}