# Zerenity 1.1

**URL:** <https://www.ruby-forum.com/t/zerenity-1-1/65858>\
**Category:** Ruby\
**Created:** [August 21, 2006, 11:08pm UTC](https://www.ruby-forum.com/t/zerenity-1-1/65858 "2006-08-21T23:08:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farrel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9d8465/32.png) [@Farrel\_L](https://www.ruby-forum.com/u/Farrel_L)\
**Post date:** [August 21, 2006, 11:08pm UTC](https://www.ruby-forum.com/t/zerenity-1-1/65858/1 "2006-08-21T23:08:30Z")

</div>

Zerenity is an almost clone of  
Zenity([Best Open Source Mac Software Development Software 2023](http://freshmeat.net/projects/zenity)) for Ruby. It allows for  
the easy creation of simple graphical dialogs from a Ruby script.

= Zerenity Changelog  
== 1.1

- From this version the OK button is set as the default widget. Pressing  
Enter  
in a dialog will cause it to be fired. If you do not want your dialog  
to have  
this behavior set the :activatesDefault option to false. Note that  
certain widgets  
(List, FileSelection and TextInfo when :editable is set) do not  
allow this as Enter  
could be used for other actions. Originally suggested by Justin  
Collins.
- Instead of passing a Gtk::VBox to the build and retrieve\_selection  
methods, now  
pass in the parent Gtk::Dialog.

== Features  
Zerenity allows for the creation of the following dialogs

- Date selection
- Text entry
- Error display
- File/directory selection
- Information display
- List display and selection
- Progress display
- Question display
- Text information display and editing
- Warning display

== Dependencies  
Zerenity requires GTK2([http://www.gtk.org](http://www.gtk.org)) and  
Ruby/GTK2([http://ruby-gnome2.sourceforge.jp/hiki.cgi](http://ruby-gnome2.sourceforge.jp/hiki.cgi)).

== Installation  
Zerenity is avaiable as a Ruby gem. Links to the latest release can be  
found at [http://www.aimred.com/files/projects/zerenity](http://www.aimred.com/files/projects/zerenity).

The code is also available via it’s Subversion repository at  
[http://zerenity.googlecode.com/svn/](http://zerenity.googlecode.com/svn/)

== Example Usage  
=== User Input and Display  
require ‘zerenity’

if (name = Zerenity::Entry(:text=\>“What is your name?”))  
Zerenity::Info(:text=\>“Hello #{name}”)  
else  
puts “No name entered”  
end

=== Progress  
require ‘zerenity’

fileList = filesToProcess(folder)  
Zerenity::Progress(:text=\>‘Processing files’,:autoClose=\>true) do  
|progress|  
fileList.each\_index do |file,index|  
processFile(file)  
progress.update(index/fileList.length,“#{100\*index/fileList.length}%  
processed…”)  
end  
end

== License  
Zerenity is released under the BSD license.

== Copyright  
(c) 2006 Farrel L.

---

<div class="post-metadata">

**Author:** ![Farrel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9d8465/32.png) [@Farrel\_L](https://www.ruby-forum.com/u/Farrel_L)\
**Post date:** [August 21, 2006, 11:48pm UTC](https://www.ruby-forum.com/t/zerenity-1-1/65858/2 "2006-08-21T23:48:38Z")

</div>

Farrel L. wrote:

> this behavior set the :activatesDefault option to false. Note that  
> certain widgets  
> (List, FileSelection and TextInfo when :editable is set) do not  
> allow this as Enter  
> could be used for other actions. Originally suggested by Justin C…

Thanks! Works great. I’m really enjoying this library.

-Justin
