zenity/README.md

41 lines
1.5 KiB
Markdown
Raw Normal View History

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-09 13:37:03 -05:00
* message (error, info, question, warning)
* file selection
2020-01-09 08:26:58 -05:00
Behavior on Windows, macOS and other UNIXes might differ sliglty.
Some of that is intended (reflecting platform differences),
other bits are unfortunate limitations,
others still open to be fixed.
## Why?
There are a bunch of other dialog packages for Go.
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
* on macOS:
2020-01-09 13:37:03 -05:00
* only dependency is `osascript` (with [JXA](https://developer.apple.com/library/archive/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/Articles/Introduction.html))
* JavaScript is easier to template with `html/template`
2020-01-09 08:26:58 -05:00
* on other UNIXes:
2020-01-09 13:37:03 -05:00
* wraps either one of `matedialog`, `qarma`, `zenity`
* in that order of preference, most to least specific