2020-01-09 08:26:58 -05:00
|
|
|
# Zenity dialogs for Golang, Windows and macOS
|
|
|
|
|
|
|
|
[![GoDoc](https://godoc.org/github.com/ncruces/zenity?status.svg)](https://godoc.org/github.com/ncruces/zenity)
|
|
|
|
|
|
|
|
This repo includes both a cross-platform Go package providing [Zenity](https://help.gnome.org/users/zenity/)-like dialogs,
|
|
|
|
as well as a *“port”* of the `zenity` command to both Windows and macOS based on that library.
|
|
|
|
|
|
|
|
**This is a work in progress.**
|
|
|
|
|
|
|
|
Lots of things are missing.
|
|
|
|
For now, these are the only implemented dialogs:
|
2020-01-13 21:26:25 -05:00
|
|
|
* [message](https://github.com/ncruces/zenity/wiki/Message-dialog) (error, info, question, warning)
|
|
|
|
* [file selection](https://github.com/ncruces/zenity/wiki/File-Selection-dialog)
|
2020-01-09 08:26:58 -05:00
|
|
|
|
2020-01-15 10:06:42 -05:00
|
|
|
Behavior on Windows, macOS and other Unixes might differ slightly.
|
2020-01-09 08:26:58 -05:00
|
|
|
Some of that is intended (reflecting platform differences),
|
|
|
|
other bits are unfortunate limitations,
|
2020-01-10 07:00:38 -05:00
|
|
|
others still are open to be fixed.
|
2020-01-09 08:26:58 -05:00
|
|
|
|
|
|
|
## Why?
|
|
|
|
|
2020-01-10 07:00:38 -05:00
|
|
|
There are a bunch of other dialog packages for Go.\
|
2020-01-09 08:26:58 -05:00
|
|
|
Why reinvent this particular wheel?
|
|
|
|
|
|
|
|
#### Requirements:
|
|
|
|
|
|
|
|
* no `cgo` (see [benefits](https://dave.cheney.net/2016/01/18/cgo-is-not-go), mostly cross-compilation)
|
|
|
|
* no main loop (or other threading requirements)
|
|
|
|
* no initialization
|
|
|
|
* on Windows:
|
2020-01-09 13:37:03 -05:00
|
|
|
* no additional dependencies
|
|
|
|
* Explorer shell not required
|
|
|
|
* works in Server Core
|
2020-01-09 08:26:58 -05:00
|
|
|
* Unicode support
|
2020-01-17 09:23:34 -05:00
|
|
|
* WSL/Cygwin/MSYS2 [support](https://github.com/ncruces/zenity/wiki/Zenity-for-WSL,-Cygwin,-MSYS2)
|
2020-01-09 08:26:58 -05:00
|
|
|
* on macOS:
|
2020-01-19 06:57:05 -05:00
|
|
|
* only dependency is `osascript`
|
|
|
|
(with [JXA](https://developer.apple.com/library/archive/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/Articles/Introduction.html);
|
|
|
|
`html/template` makes JavaScript easy to template)
|
2020-01-15 10:06:42 -05:00
|
|
|
* on other Unixes:
|
2020-01-11 07:10:09 -05:00
|
|
|
* wraps either one of `qarma`, `zenity`, `matedialog`,\
|
|
|
|
in that order of preference
|