Giter Club home page Giter Club logo

zenity's Introduction

Zenity dialogs for Golang, Windows and macOS

Go Reference Go Report Go Coverage Mentioned in Awesome Go

This repo includes:

  • a cross-platform Go package providing Zenity-like dialogs (simple dialogs that interact graphically with the user)
  • a β€œport” of the zenity command to both Windows and macOS based on that library.

Implemented dialogs:

Behavior on Windows, macOS and other Unixes might differ slightly. Some of that is intended (reflecting platform differences), other bits are unfortunate limitations.

Installing

The Go package:

go get github.com/ncruces/zenity@latest

The zenity command on macOS/WSL using Homebrew 🍺:

brew install ncruces/tap/zenity

The zenity command on Windows using Scoop 🍨:

scoop install https://ncruces.github.io/scoop/zenity.json

The zenity command on macOS/Windows, if you have Go:

go install github.com/ncruces/zenity/cmd/zenity@latest

Or download the latest release.

Using

For the Go package, consult the documentation and examples.

The zenity command does its best to be compatible with the GNOME version.
Consult the documentation and man page of that command.

Why?

Benefits of the Go package:

  • no cgo (see benefits, mostly cross-compilation)
  • no main loop (or any other threading or initialization requirements)
  • cancelation through context
  • on Windows:
    • no additional dependencies
      • Explorer shell not required
      • works in Server Core
    • Unicode support
    • High DPI (no manifest required)
    • Visual Styles (no manifest required)
    • WSL/Cygwin/MSYS2 support
  • on macOS:
    • only dependency is osascript
  • on other Unixes:
    • wraps either one of zenity, matedialog, qarma

Zenity wrappers

Zenity wrappers for languages other than Go can benefit from our zenity command. On Unix (Linux, FreeBSD, etc) they can use the original tool, and on Windows/macOS they may use the command from this repo for portability.

Examples:

Credits

I'd like to thank all contributors, but @gen2brain in particular for dlgs, which was instrumental to the Windows port of zenity.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.