Skip to content

Instantly share code, notes, and snippets.

@breezhang
Last active March 26, 2019 13:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save breezhang/7732470 to your computer and use it in GitHub Desktop.
Save breezhang/7732470 to your computer and use it in GitHub Desktop.
zenity for win7 example
get from
http://osspack32.googlecode.com/files/zenity.exe
modified src: http://osspack32.googlecode.com/files/zenity-3.6.0_src.7z
enjoy cmd script
for /f %i in ('zenity --calendar --title="Select a Date" --text="Click on a date to select that date." --day=1 --month=12 --year=2013 ') do @echo %i
for /f %i in ('zenity --color-selection --show-palette') do echo %i
for /f %i in ('zenity --file-selection --title="Select a File" ') do @echo %i
@for /f "delims=," %%i in ('zenity --forms --title="Add Friend" --text="Enter information about your friend." --separator="," --add-entry="First Name" --add-entry="Family Name" --add-entry="Email" --add-calendar="Birthday"') do @echo %%i
if %ERRORLEVEL% ==0 echo "ADD OK"
if %ERRORLEVEL% == 1 goto error
zenity --info --text="You pressed YES!"
goto end
:error
zenity --error --text="!====!"
:end
for /f %i in ('zenity --entry --title="Add new profile" --text="Enter name of
new profile:" --entry-text "NewProfile"') do @echo %i
for %f %i in ('zenity --list --title="Choose the Bugs You Wish to View" --column="Bug Number" --column="Severity" --column="Description" 992383 Normal "GtkTreeView crashes on multiple selections" 293823 High "GNOME Dictionary does not handle proxy" 393823 Critical "Menu editing does not work in GNOME 2.0"') do @echo %i
:need admin
zenity --notification --window-icon="info" --text="There are system updates necessary!"
for /f "tokens=1,2 delims=|" %i in ('zenity --password --username') do @echo %i %j
cmd /c "for /l %i in (10,10,100) do @echo %i && sleep 1" |zenity --progress --percentage=0 --auto-close
@echo off
zenity --question --ok-label="YES" --cancel-label="NO" --text="Did you have a nice day?"
if %ERRORLEVEL% == 1 goto error
zenity --info --text="You pressed YES!"
goto end
:error
zenity --error --text="You pressed NO!"
:end
@MartinMolhanec
Copy link

Seem to me, that notification option is not implemented in windows version of Zenity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment