MCPcopy Index your code
hub / github.com/ncruces/zenity

github.com/ncruces/zenity @v0.10.14

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.10.14 ↗ · + Follow
500 symbols 1,838 edges 98 files 133 documented · 27% 4 cross-repo links

Browse by type

Functions 432 Types & classes 68
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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: * message (error, info, question, warning) * text entry * list (simple) * password * file selection * color selection * calendar * progress * notification

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: - NodeJS dialog-gui by @SnurfDev - Crystal zenity.cr by @kojix2

Credits

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

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 364
Method 68
Struct 57
TypeAlias 8
Interface 2
FuncType 1

Languages

Go100%

Modules by API surface

internal/win/zsyscall_windows.go60 symbols
internal/win/shell32.go32 symbols
util_windows.go26 symbols
zenity.go24 symbols
file.go20 symbols
internal/zenutil/run_darwin.go19 symbols
cmd/zenity/main.go17 symbols
progress.go13 symbols
file_windows.go12 symbols
util_test.go11 symbols
progress_windows.go11 symbols
internal/win/user32.go11 symbols

For agents

$ claude mcp add zenity \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page