Zenity dialogs for Golang, Windows, macOS
Fork of https://github.com/ncruces/zenity
cmd/zenity | ||
internal | ||
.gitignore | ||
file.go | ||
file_darwin.go | ||
file_test.go | ||
file_unix.go | ||
file_windows.go | ||
go.mod | ||
go.sum | ||
init_windows.go | ||
init_windows_test.go | ||
LICENSE | ||
msg_darwin.go | ||
msg_test.go | ||
msg_unix.go | ||
msg_windows.go | ||
README.md | ||
zenity.go |
Zenity dialogs for Golang, Windows and macOS
This repo includes both a cross-platform Go package providing 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:
- message (error, info, question, warning)
- file selection
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, mostly cross-compilation) - no main loop (or other threading requirements)
- no initialization
- on Windows:
- no additional dependencies
- Explorer shell not required
- works in Server Core
- Unicode support
- no additional dependencies
- on macOS:
- only dependency is
osascript
(with JXA)- JavaScript is easier to template with
html/template
- JavaScript is easier to template with
- only dependency is
- on other UNIXes:
- wraps either one of
qarma
,zenity
,matedialog
- in that order of preference
- wraps either one of