GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Contents
  • Current events
  • Random article
  • About Wikipedia
  • Contact us
  • Help
  • Learn to edit
  • Community portal
  • Recent changes
  • Upload file
  • Special pages
  • Search
  • Donate

This view

  • Original page
  • New address

GeezerVison is showing en.wikipedia.org — Zenity - Wikipedia

icon
This article's lead section may be too short to adequately summarize the key points. Please consider expanding the lead to provide an accessible overview of all important aspects of the article. (February 2013) (Learn how and when to remove this message)
Zenity
Example of a Zenity dialog box
Original authorSun Microsystems
DevelopersGlynn Foster
Lucas Rocha
Stable release
4.2.1[1] Edit this on Wikidata / 7 November 2025 (7 November 2025)
Operating systemUnix-like
LicenseGNU Lesser General Public License
Websitegitlab.gnome.org/GNOME/zenity
Repository
  • gitlab.gnome.org/GNOME/zenity.git

Zenity is a free software and cross-platform computer program that allows the execution of GTK dialog boxes in command-line and shell scripts.

Description

Like tools such as whiptail and dialog, Zenity allows easy creation of GUIs,[2] though it has fewer features than more complex GUI-creation tools.[3]

Other scripting languages such as Perl and Python can be used to construct full-scale GUI applications, but the zenity program enables a shell script to interact with a GUI user.... [The] user interface is not as refined as one that could be provided by a full-featured GUI application, but it is perfectly suitable for simple interactions.

— Chris Tyler[4]

Cross-platform compatibility

As of 2012, Zenity is available for Linux, BSD and Windows.[5] A Zenity port to Mac OS X is available in MacPorts and Homebrew.

As of 2018, Zenity ports for Windows are available: zenity-windows (based on version 3.20.0) and winzenity (based on 3.8.0 / statically linked)

Zenity does not possess any built-in scripting capabilities and it must, therefore, rely on an interpreter for processing. One option is Python in combination with the PyZenity library.[6]

Examples

Python example

from PyZenity import InfoMessage
from PyZenity import Question
from PyZenity import ErrorMessage

choice = Question("Please press a button.")

if choice:
    InfoMessage("You pressed Yes!")
else:
    ErrorMessage("You pressed No!")

POSIX shell script example

#!/bin/sh

if zenity --question --text="Please press a button."; then
zenity --info --text="You pressed Yes\!"
else
zenity --error --text="You pressed No\!"
fi

Windows shell script example

@echo off
zenity --question --ok-label="Yes" --cancel-label="No" --text="Please press a button."
if %ERRORLEVEL% == 1 goto error
zenity --info --text="You pressed Yes!"
goto end
:error
zenity --error --text="You pressed No!"
:end

See also

  • GTK-server
  • Dialog
  • List of GNOME applications

References

  1. ↑ https://gitlab.gnome.org/GNOME/zenity/-/releases/4.2.1. {{cite web}}: Missing or empty |title= (help)
  2. ↑ Cartwright, Ryan (2009-01-30), "More fun with Zenity: shell script/GUI interactivity", Free Software Magazine, archived from the original on 2011-11-06, retrieved 2011-12-10
  3. ↑ Diehl, Mike (2008-05-12), "Make Your Scripts User Friendly with Zenity", LinuxJournal, archived from the original on 2011-11-26, retrieved 2011-12-10
  4. ↑ Tyler, Chris (2006), "Chapter 4. Basic System Management", Fedora Linux, O'Reilly Media, pp. 258–259, ISBN 978-0-596-52682-5, archived from the original on 2011-07-15, retrieved 2010-03-15
  5. ↑ Zenity for Windows, archived from the original on 2012-01-12, retrieved 2011-12-10
  6. ↑ Ramos, Brian (2011-04-20), PyZenity, archived from the original on 2013-10-07, retrieved 2012-11-15

External links

  • Official website


Stub icon

This free and open-source software article is a stub. You can help Wikipedia by adding missing information.

  • v
  • t
  • e
Retrieved from "https://en.wikipedia.org/w/index.php?title=Zenity&oldid=1346780005"
Categories:
  • GNOME Applications
  • GNOME Developer Tools
  • GTK
  • Sun Microsystems software
  • Free and open-source software stubs
Hidden categories:
  • Articles with short description
  • Short description is different from Wikidata
  • Wikipedia introduction cleanup from February 2013
  • All pages needing cleanup
  • Articles covered by WikiProject Wikify from February 2013
  • All articles covered by WikiProject Wikify
  • CS1 errors: missing title
  • CS1 errors: bare URL
  • Articles containing potentially dated statements from 2012
  • All articles containing potentially dated statements
  • Official website different in Wikidata and Wikipedia
  • All articles with dead external links
  • Articles with dead external links from April 2026
  • All stub articles
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.