2003-01-15 10:28:19 +00:00
<?xml version="1.0"?>
< !DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
2004-08-18 18:10:27 +00:00
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY author1 "Sun">
<!ENTITY author2 "Java Desktop System Documentation Team">
<!ENTITY publisher "Sun Microsystems, Inc.">
<!ENTITY legal SYSTEM "legal.xml">
<!ENTITY appversion "2.6.0">
<!ENTITY app "<application> Zenity</application> ">
<!ENTITY appname "Zenity">
<!ENTITY date "August 2004">
<!ENTITY manrevision "2.0">
2003-01-15 10:28:19 +00:00
]>
<!-- ================ Document Header ================= -->
<article id= "index" lang= "en" >
<articleinfo >
2005-10-18 13:21:10 +00:00
<title > &appname; Manual</title>
2004-08-18 18:10:27 +00:00
<subtitle > &appname; Desktop Application Manual V&manrevision; </subtitle>
2003-01-15 10:28:19 +00:00
<copyright >
<year > 2003</year>
2004-08-18 18:10:27 +00:00
<year > 2004</year>
<holder > &publisher; </holder>
2003-01-15 10:28:19 +00:00
</copyright>
<!-- Translators: uncomment this
<copyright >
2004-08-18 18:10:27 +00:00
<year > 2004</year>
2003-01-15 10:28:19 +00:00
<holder > ME_THE_TRANSLATOR</holder>
</copyright>
-->
<publisher >
2004-08-18 18:10:27 +00:00
<publishername > &publisher; </publishername>
2003-01-15 10:28:19 +00:00
</publisher>
2004-08-18 18:10:27 +00:00
&legal;
2003-01-15 10:28:19 +00:00
<authorgroup >
2004-08-18 18:10:27 +00:00
<author >
<firstname > &author1; </firstname>
<surname > &author2; </surname>
<affiliation > <orgname > &publisher; </orgname> </affiliation>
</author>
2005-07-25 01:06:32 +00:00
<author role= "maintainer" >
2004-08-18 18:10:27 +00:00
<firstname > Glynn</firstname>
<surname > Foster</surname>
<affiliation >
<orgname > GNOME Documentation Project</orgname>
</affiliation>
</author>
<editor >
<firstname > Nicholas</firstname>
<surname > Curran</surname>
<affiliation >
<orgname > GNOME Documentation Project</orgname>
</affiliation>
</editor>
2003-01-15 10:28:19 +00:00
</authorgroup>
<revhistory >
2004-08-18 18:10:27 +00:00
<revision >
<revnumber > &appname; Desktop Application Manual V&manrevision; </revnumber>
<date > &date; </date>
<revdescription >
<para role= "author" > &author1; &author2; </para>
<para role= "publisher" > &publisher; </para>
</revdescription>
</revision>
<revision >
<revnumber > Zenity Manual V1.0</revnumber>
<date > January 2003</date>
<revdescription >
<para role= "author" > Glynn Foster</para>
<para role= "publisher" > GNOME Documentation Project </para>
</revdescription>
</revision>
2003-01-15 10:28:19 +00:00
</revhistory>
2004-08-18 18:10:27 +00:00
<releaseinfo > This manual describes version &appversion; of &appname; .
</releaseinfo>
<legalnotice >
<title > Feedback</title>
<para >
To send feedback, follow the directions in the <ulink url= "ghelp:gnome-feedback" type= "help" > Feedback Page</ulink> .
</para>
<!-- Translators may also add here feedback address for translations -->
</legalnotice>
2005-07-25 01:06:32 +00:00
<abstract role= "description" >
2005-10-18 13:21:10 +00:00
<para > Zenity is a rewrite of gdialog, the GNOME port of dialog which allows you to
display dialog boxes from the commandline and shell scripts.
</para>
2005-07-25 01:06:32 +00:00
</abstract>
2003-01-15 10:28:19 +00:00
</articleinfo>
2004-08-18 18:10:27 +00:00
<indexterm >
<primary > zenity command</primary>
</indexterm>
<indexterm >
<primary > dialog creator</primary>
</indexterm>
2003-01-15 10:28:19 +00:00
<!-- ================ Document Body ================= -->
2003-01-18 14:28:54 +00:00
<!-- ==== Introduction ====== -->
<sect1 id= "zenity-introduction" >
<title > Introduction</title>
<para >
2004-08-18 18:10:27 +00:00
&app; enables you to create the following types of simple dialog:
2003-01-18 14:28:54 +00:00
</para>
2003-09-01 08:27:59 +00:00
<itemizedlist >
2004-08-18 18:10:27 +00:00
<listitem > <para > Calendar</para> </listitem>
<listitem > <para > File selection</para> </listitem>
<listitem > <para > List</para> </listitem>
2005-02-06 23:13:16 +00:00
<listitem > <para > Notification icon</para> </listitem>
2004-08-18 18:10:27 +00:00
<listitem > <para > Message</para>
2003-09-01 08:27:59 +00:00
<itemizedlist >
2004-08-18 18:10:27 +00:00
<listitem > <para > Error</para> </listitem>
<listitem > <para > Information</para> </listitem>
<listitem > <para > Question</para> </listitem>
<listitem > <para > Warning</para> </listitem>
2003-09-01 08:27:59 +00:00
</itemizedlist>
</listitem>
2004-08-18 18:10:27 +00:00
<listitem > <para > Progress</para> </listitem>
<listitem > <para > Text entry</para> </listitem>
<listitem > <para > Text information</para> </listitem>
2003-09-01 08:27:59 +00:00
</itemizedlist>
2003-01-18 18:02:14 +00:00
</sect1>
2004-08-18 18:10:27 +00:00
<!-- ==== Usage ====== -->
<sect1 id= "zenity-usage" >
<title > Usage</title>
2003-01-18 18:02:14 +00:00
<para >
2004-08-18 18:10:27 +00:00
When you write scripts, you can use &app; to create simple dialogs that interact graphically with the user, as follows:
2003-01-22 01:50:28 +00:00
</para>
2004-08-18 18:10:27 +00:00
<itemizedlist >
<listitem >
<para >
You can create a dialog to obtain information from the user. For example, you can prompt the user to select a date from a calendar dialog, or to select a file from a file selection dialog.
</para>
</listitem>
<listitem >
<para >
You can create a dialog to provide the user with information. For example, you can use a progress dialog to indicate the current status of an operation, or use a warning message dialog to alert the user.
</para>
</listitem>
</itemizedlist>
2003-01-22 01:50:28 +00:00
<para >
2004-08-18 18:10:27 +00:00
When the user closes the dialog, &app; prints the text produced by the dialog to standard error.
2003-01-22 01:50:28 +00:00
</para>
2003-09-01 08:27:59 +00:00
<note >
2004-08-18 18:10:27 +00:00
<para >
When you write &app; commands, ensure that you place quotation marks around each argument.
</para>
<para >
For example, use: <screen > <userinput > <command > zenity --calendar --title="Holiday Planner"</command> </userinput> </screen> Do not use: <screen > <userinput > <command > zenity --calendar --title=Holiday Planner</command> </userinput> </screen>
</para>
<para >
If you do not use quotation marks, you might get unexpected results.
</para>
</note>
<sect2 id= "zenity-usage-mnemonics" >
<title > Access Keys</title>
2003-09-01 08:27:59 +00:00
<para >
2004-08-18 18:10:27 +00:00
An access key is a key that enables you to perform an action from the keyboard rather than use the mouse to choose a command from a menu or dialog. Each access key is identified by an underlined letter on a menu or dialog option.
2003-09-01 08:27:59 +00:00
</para>
2004-08-18 18:10:27 +00:00
<para >
Some &app; dialogs support the use of access keys. To specify the character to use as the access key, place an underscore before that character in the text of the dialog. The following example shows how to specify the letter 'C' as the access key:
</para>
<screen > <userinput > "_Choose a name".</userinput> </screen>
</sect2>
2003-09-01 08:27:59 +00:00
2004-08-18 18:10:27 +00:00
<sect2 id= "zenity-usage-exitcodes" >
<title > Exit Codes</title>
2003-01-18 18:02:14 +00:00
<para >
2003-09-01 08:27:59 +00:00
&app; returns the following exit codes:
2003-01-18 18:02:14 +00:00
</para>
2004-08-18 18:10:27 +00:00
<informaltable frame= "all" >
<tgroup cols= "2" colsep= "1" rowsep= "1" >
<colspec colname= "COLSPEC0" colwidth= "50*" />
<colspec colname= "COLSPEC1" colwidth= "50*" />
<thead >
<row valign= "top" >
<entry colname= "COLSPEC0" >
<para > Exit Code</para> </entry>
<entry colname= "COLSPEC1" >
<para > Description</para> </entry>
</row>
</thead>
<tbody >
<row valign= "top" >
<entry >
<para > <varname > 0</varname> </para>
</entry>
<entry >
<para > The user has pressed either <guibutton > OK</guibutton> or <guibutton > Close</guibutton> .</para>
</entry>
</row>
<row valign= "top" >
<entry >
<para > <varname > 1</varname> </para>
</entry>
<entry >
<para > The user has either pressed <guibutton > Cancel</guibutton> , or used the window functions to close the dialog.</para>
</entry>
</row>
<row valign= "top" >
<entry >
<para > <varname > -1</varname> </para>
</entry>
<entry >
<para > An unexpected error has occurred.</para>
</entry>
</row>
2009-01-09 00:03:05 +00:00
<row valign= "top" >
<entry >
<para > <varname > 5</varname> </para>
</entry>
<entry >
<para > The dialog has been closed because the timeout has been reached.</para>
</entry>
</row>
2004-08-18 18:10:27 +00:00
</tbody>
</tgroup>
</informaltable>
</sect2>
<!-- ==== General Options ====== -->
<sect2 id= "zenity-usage-general-options" >
<title > General Options</title>
<para >
All &app; dialogs support the following general options:
</para>
2003-01-18 18:02:14 +00:00
<variablelist >
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --title</option> =<replaceable > title</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the title of a dialog.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
2004-08-18 18:10:27 +00:00
<varlistentry >
<term > <option > --window-icon</option> =<replaceable > icon_path</replaceable> </term>
<listitem >
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
<para > Specifies the icon that is displayed in the window frame of the dialog. There are
4 stock icons also available by providing the following keywords - 'info', 'warning', 'question' and
'error'.
</para>
2004-08-18 18:10:27 +00:00
</listitem>
</varlistentry>
2003-01-18 18:02:14 +00:00
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --width</option> =<replaceable > width</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the width of the dialog.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --height</option> =<replaceable > height</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the height of the dialog.</para>
2003-01-18 14:28:54 +00:00
</listitem>
</varlistentry>
2009-01-09 00:03:05 +00:00
<varlistentry >
<term > <option > --timeout</option> =<replaceable > timeout</replaceable> </term>
<listitem >
<para > Specifies the timeout in seconds after which the dialog is closed.</para>
</listitem>
</varlistentry>
2003-01-18 14:28:54 +00:00
</variablelist>
2003-01-18 18:02:14 +00:00
2004-08-18 18:10:27 +00:00
</sect2>
2003-01-18 14:28:54 +00:00
2004-08-18 18:10:27 +00:00
<!-- ==== Miscellaneous Options ====== -->
2003-01-18 14:28:54 +00:00
2004-08-18 18:10:27 +00:00
<sect2 id= "zenity-help-options" >
<title > Help Options</title>
2003-01-18 14:28:54 +00:00
<para >
2004-08-18 18:10:27 +00:00
&app; provides the following help options:
2003-01-18 14:28:54 +00:00
</para>
<variablelist >
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --help</option> </term>
2003-01-18 14:28:54 +00:00
<listitem >
2005-02-06 23:13:16 +00:00
<para > Displays shortened help text.</para>
2003-01-18 14:28:54 +00:00
</listitem>
</varlistentry>
<varlistentry >
2005-02-06 23:13:16 +00:00
<term > <option > --help-all</option> </term>
2003-01-18 14:28:54 +00:00
<listitem >
2005-02-06 23:13:16 +00:00
<para > Displays full help text for all dialogs.</para>
2003-01-18 14:28:54 +00:00
</listitem>
</varlistentry>
2005-02-06 23:13:16 +00:00
<varlistentry >
<term > <option > --help-general</option> </term>
<listitem >
<para > Displays help text for general dialog options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-calendar</option> </term>
<listitem >
<para > Displays help text for calendar dialog options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-entry</option> </term>
<listitem >
<para > Displays help text for text entry dialog options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-error</option> </term>
<listitem >
<para > Displays help text for error dialog options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-info</option> </term>
<listitem >
<para > Displays help text for information dialog options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-file-selection</option> </term>
<listitem >
<para > Displays help text for file selection dialog options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-list</option> </term>
<listitem >
<para > Displays help text for list dialog options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-notification</option> </term>
<listitem >
<para > Displays help text for notification icon options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-progress</option> </term>
<listitem >
<para > Displays help text for progress dialog options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-question</option> </term>
<listitem >
<para > Displays help text for question dialog options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-warning</option> </term>
<listitem >
<para > Displays help text for warning dialog options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-text-info</option> </term>
<listitem >
<para > Displays help for text information dialog options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-misc</option> </term>
<listitem >
<para > Displays help for miscellaneous options.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --help-gtk</option> </term>
<listitem >
<para > Displays help for GTK+ options.</para>
</listitem>
</varlistentry>
2004-08-18 18:10:27 +00:00
</variablelist>
</sect2>
<!-- ==== Miscellaneous Options ====== -->
<sect2 id= "zenity-miscellaneous-options" >
<title > Miscellaneous Options</title>
<para >
&app; also provides the following miscellaneous options:
</para>
<variablelist >
2003-05-05 22:38:54 +00:00
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --about</option> </term>
2003-05-05 22:38:54 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Displays the <guilabel > About &appname; </guilabel> dialog, which contains &app; version information, copyright information, and developer information.</para>
2003-05-05 22:38:54 +00:00
</listitem>
</varlistentry>
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --version</option> </term>
2003-05-05 22:38:54 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Displays the version number of &app; .</para>
2003-05-05 22:38:54 +00:00
</listitem>
</varlistentry>
2003-01-18 14:28:54 +00:00
</variablelist>
2003-01-18 18:02:14 +00:00
2004-08-18 18:10:27 +00:00
</sect2>
<!-- ==== GTK+ Options ====== -->
2003-01-18 14:28:54 +00:00
2004-08-18 18:10:27 +00:00
<sect2 id= "zenity-gtk-options" >
<title > GTK+ Options</title>
<para >
&app; supports the standard GTK+ options. For more information about the GTK+ options, execute the <command > zenity -?</command> command.
</para>
</sect2>
</sect1>
2003-01-18 18:02:14 +00:00
<!-- ==== Calendar Options ====== -->
2003-01-18 14:28:54 +00:00
2003-01-18 18:02:14 +00:00
<sect1 id= "zenity-calendar-options" >
2003-09-01 08:27:59 +00:00
<title > Calendar Dialog</title>
2003-01-18 14:28:54 +00:00
2003-01-18 18:02:14 +00:00
<para >
2004-08-18 18:10:27 +00:00
Use the <option > --calendar</option> option to create a calendar dialog. &app; returns the selected date to standard error. If no date is specified on the command line, the dialog uses the current date.
2003-01-22 01:50:28 +00:00
</para>
<para >
2004-08-18 18:10:27 +00:00
The calendar dialog supports the following options:
2003-01-18 18:02:14 +00:00
</para>
2003-01-18 14:28:54 +00:00
2003-01-18 18:02:14 +00:00
<variablelist >
2003-01-18 14:28:54 +00:00
2003-01-18 18:02:14 +00:00
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --text</option> =<replaceable > text</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the text that is displayed in the calendar dialog.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --day</option> =<replaceable > day</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the day that is selected in the calendar dialog. <replaceable > day</replaceable> must be a number between 1 and 31 inclusive.
2003-01-18 18:02:14 +00:00
</para>
</listitem>
</varlistentry>
2003-01-18 14:28:54 +00:00
2003-01-18 18:02:14 +00:00
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --month</option> =<replaceable > month</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the month that is selected in the calendar dialog. <replaceable > month</replaceable> must be a number between 1 and 12 inclusive.
2003-01-18 18:02:14 +00:00
</para>
</listitem>
</varlistentry>
2003-01-18 14:28:54 +00:00
2003-01-18 18:02:14 +00:00
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --year</option> =<replaceable > year</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the year that is selected in the calendar dialog.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
2003-01-18 14:28:54 +00:00
2003-01-18 18:02:14 +00:00
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --date-format</option> =<replaceable > format</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the format that is returned from the calendar dialog after date selection. The default format depends on your locale. <replaceable > format</replaceable> must be a format that is acceptable to the <command > strftime</command> function, for example <literal > %A %d/%m/%y</literal> .
2003-09-01 08:27:59 +00:00
</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
2003-01-18 14:28:54 +00:00
2003-01-18 18:02:14 +00:00
</variablelist>
2003-01-18 14:28:54 +00:00
2003-01-22 01:50:28 +00:00
<para >
2004-08-18 18:10:27 +00:00
The following example script shows how to create a calendar dialog:
<programlisting >
#!/bin/sh
2003-01-22 01:50:28 +00:00
2004-08-18 18:10:27 +00:00
if zenity --calendar \
--title="Select a Date" \
--text="Click on a date to select that date." \
--day=10 --month=8 --year=2004
then echo $?
else echo "No date selected"
fi
</programlisting>
2003-01-22 01:50:28 +00:00
</para>
2003-01-18 14:28:54 +00:00
2003-09-01 08:27:59 +00:00
<figure id= "zenity-calendar-screenshot" >
2004-08-18 18:10:27 +00:00
<title > Calendar Dialog Example</title>
2003-09-01 08:27:59 +00:00
<screenshot >
<mediaobject >
<imageobject >
<imagedata fileref= "figures/zenity-calendar-screenshot.png" format= "PNG" />
</imageobject>
<textobject >
2004-08-18 18:10:27 +00:00
<phrase > &app; calendar dialog example</phrase>
2003-09-01 08:27:59 +00:00
</textobject>
</mediaobject>
</screenshot>
</figure>
2003-01-18 18:02:14 +00:00
</sect1>
2003-01-18 14:28:54 +00:00
2004-08-18 18:10:27 +00:00
<!-- ==== File Selection Options ====== -->
<sect1 id= "zenity-file-selection-options" >
<title > File Selection Dialog</title>
2003-01-18 18:02:14 +00:00
<para >
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
Use the <option > --file-selection</option> option to create a file selection dialog. &app; returns the selected files or directories to standard
error. The default mode of the file selection dialog is open.
2004-08-18 18:10:27 +00:00
</para>
<para >
The file selection dialog supports the following options:
2003-01-18 18:02:14 +00:00
</para>
<variablelist >
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --filename</option> =<replaceable > filename</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the file or directory that is selected in the file selection dialog when the dialog is first shown.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --multiple</option> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Allows the selection of multiple filenames in the file selection dialog.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
<varlistentry >
<term > <option > --directory</option> </term>
<listitem >
<para > Allows only selection of directories in the file selection dialog.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --save</option> </term>
<listitem >
<para > Set the file selection dialog into save mode.</para>
</listitem>
</varlistentry>
2003-01-18 18:02:14 +00:00
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --separator</option> =<replaceable > separator</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the string that is used to divide the returned list of filenames.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
</variablelist>
2003-01-22 01:50:28 +00:00
<para >
2004-08-18 18:10:27 +00:00
The following example script shows how to create a file selection dialog:
<programlisting >
#!/bin/sh
FILE=`zenity --file-selection --title="Select a File"`
case $? in
0)
echo "\"$FILE\" selected.";;
1)
echo "No file selected.";;
-1)
echo "No file selected.";;
esac
</programlisting>
</para>
2003-01-22 01:50:28 +00:00
2004-08-18 18:10:27 +00:00
<figure id= "zenity-fileselection-screenshot" >
<title > File Selection Dialog Example</title>
<screenshot >
<mediaobject >
<imageobject >
<imagedata fileref= "figures/zenity-fileselection-screenshot.png" format= "PNG" />
</imageobject>
<textobject >
<phrase > &app; file selection dialog example</phrase>
</textobject>
</mediaobject>
</screenshot>
</figure>
2003-01-22 01:50:28 +00:00
2004-08-18 18:10:27 +00:00
</sect1>
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
<!-- ==== Notification Options ====== -->
<sect1 id= "zenity-notification-options" >
<title > Notification Icon</title>
<para >
</para>
<variablelist >
<varlistentry >
<term > <option > --text</option> =<replaceable > text</replaceable> </term>
<listitem >
<para > Specifies the text that is displayed in the notification area.</para>
</listitem>
</varlistentry>
</variablelist>
<para >
The following example script shows how to create a notification icon:
<programlisting >
#!/bin/sh
zenity --notification\
--window-icon="info" \
--text="There are system updates necessary!"
</programlisting>
</para>
<figure id= "zenity-notification-screenshot" >
<title > Notification Icon Example</title>
<screenshot >
<mediaobject >
<imageobject >
<imagedata fileref= "figures/zenity-notification-screenshot.png" format= "PNG" />
</imageobject>
<textobject >
<phrase > &app; notification icon example</phrase>
</textobject>
</mediaobject>
</screenshot>
</figure>
</sect1>
2004-08-18 18:10:27 +00:00
<!-- ==== List Options ====== -->
<sect1 id= "zenity-list-options" >
<title > List Dialog</title>
<para >
Use the <option > --list</option> option to create a list dialog. &app; returns the entries in the first column of text of selected rows to standard error.
2003-01-22 01:50:28 +00:00
</para>
2003-01-18 19:04:26 +00:00
2004-08-18 18:10:27 +00:00
<para >
Data for the dialog must specified column by column, row by row. Data can be provided to the dialog through standard input. Each entry must be separated by a newline character.
</para>
<para >
If you use the <option > --checklist</option> or <option > --radiolist</option> options, each row must start with either 'TRUE' or 'FALSE'.
</para>
<para >
The list dialog supports the following options:
</para>
<variablelist >
<varlistentry >
<term > <option > --column</option> =<replaceable > column</replaceable> </term>
<listitem >
<para > Specifies the column headers that are displayed in the list dialog. You must specify a <option > --column</option> option for each column that you want to display in the dialog.
</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --checklist</option> </term>
<listitem >
<para > Specifies that the first column in the list dialog contains check boxes.
</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --radiolist</option> </term>
<listitem >
<para > Specifies that the first column in the list dialog contains radio boxes.
</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --editable</option> </term>
<listitem >
<para > Allows the displayed items to be edited.
</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --separator</option> =<replaceable > separator</replaceable> </term>
<listitem >
<para > Specifies what string is used when the list dialog returns the selected entries.
</para>
</listitem>
</varlistentry>
2004-08-22 08:32:02 +00:00
<varlistentry >
<term > <option > --print-column</option> =<replaceable > column</replaceable> </term>
<listitem >
<para > Specifies what column should be printed out upon selection. The default column is
'1'. 'ALL' can be used to print out all columns in the list.
</para>
</listitem>
</varlistentry>
2004-08-18 18:10:27 +00:00
</variablelist>
<para >
The following example script shows how to create a list dialog:
<programlisting >
#!/bin/sh
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"
</programlisting>
</para>
<figure id= "zenity-list-screenshot" >
<title > List Dialog Example</title>
2003-01-18 19:04:26 +00:00
<screenshot >
<mediaobject >
<imageobject >
2004-08-18 18:10:27 +00:00
<imagedata fileref= "figures/zenity-list-screenshot.png" format= "PNG" />
2003-01-18 19:04:26 +00:00
</imageobject>
<textobject >
2004-08-18 18:10:27 +00:00
<phrase > &app; list dialog example</phrase>
2003-01-18 19:04:26 +00:00
</textobject>
</mediaobject>
</screenshot>
</figure>
2004-08-18 18:10:27 +00:00
2003-09-01 08:27:59 +00:00
</sect1>
2003-01-18 19:04:26 +00:00
2003-09-01 08:27:59 +00:00
<!-- ==== Message Options ====== -->
2003-01-18 19:04:26 +00:00
2003-09-01 08:27:59 +00:00
<sect1 id= "zenity-message-options" >
<title > Message Dialogs</title>
2003-01-18 19:04:26 +00:00
2003-01-22 01:50:28 +00:00
<para >
2004-08-18 18:10:27 +00:00
&app; can create four types of message dialog:
2003-09-01 08:27:59 +00:00
</para>
2004-08-18 18:10:27 +00:00
<itemizedlist >
<listitem >
<para > Error</para>
</listitem>
<listitem >
<para > Information</para>
</listitem>
<listitem >
<para > Question</para>
</listitem>
<listitem >
<para > Warning</para>
</listitem>
</itemizedlist>
<para >
For each type, use the <option > --text</option> option to specify the text that is displayed in the dialog.
</para>
<sect2 id= "zenity-error-dialog" >
<title > Error Dialog</title>
2003-09-01 08:27:59 +00:00
<para >
2004-08-18 18:10:27 +00:00
Use the <option > --error</option> option to create an error dialog.
2003-09-01 08:27:59 +00:00
</para>
<para >
2004-08-18 18:10:27 +00:00
The following example script shows how to create an error dialog:
2003-01-22 01:50:28 +00:00
2004-08-18 18:10:27 +00:00
<programlisting >
#!/bin/bash
2003-01-22 01:50:28 +00:00
2004-08-18 18:10:27 +00:00
zenity --error \
--text="Could not find /var/log/syslog."
</programlisting>
2003-01-22 01:50:28 +00:00
2003-09-01 08:27:59 +00:00
</para>
<figure id= "zenity-error-screenshot" >
2004-08-18 18:10:27 +00:00
<title > Error Dialog Example</title>
2003-09-01 08:27:59 +00:00
<screenshot >
<mediaobject >
<imageobject >
<imagedata fileref= "figures/zenity-error-screenshot.png" format= "PNG" />
</imageobject>
<textobject >
2004-08-18 18:10:27 +00:00
<phrase > &app; error dialog example</phrase>
2003-09-01 08:27:59 +00:00
</textobject>
</mediaobject>
</screenshot>
</figure>
</sect2>
<sect2 id= "zenity-info-dialog" >
<title > Information Dialog</title>
<para >
2004-08-18 18:10:27 +00:00
Use the <option > --info</option> option to create an information dialog.
</para>
<para >
The following example script shows how to create an information dialog:
<programlisting >
#!/bin/bash
zenity --info \
--text="Merge complete. Updated 3 of 10 files."
</programlisting>
2003-09-01 08:27:59 +00:00
</para>
<figure id= "zenity-information-screenshot" >
2004-08-18 18:10:27 +00:00
<title > Information Dialog Example</title>
2003-09-01 08:27:59 +00:00
<screenshot >
<mediaobject >
<imageobject >
<imagedata fileref= "figures/zenity-information-screenshot.png" format= "PNG" />
</imageobject>
<textobject >
2004-08-18 18:10:27 +00:00
<phrase > &app; information dialog example</phrase>
2003-09-01 08:27:59 +00:00
</textobject>
</mediaobject>
</screenshot>
</figure>
</sect2>
<sect2 id= "zenity-question-dialog" >
<title > Question Dialog</title>
<para >
2004-08-18 18:10:27 +00:00
Use the <option > --question</option> option to create a question dialog.
</para>
<para >
The following example script shows how to create a question dialog:
<programlisting >
#!/bin/bash
zenity --question \
--text="Are you sure you wish to proceed?"
</programlisting>
2003-09-01 08:27:59 +00:00
</para>
<figure id= "zenity-question-screenshot" >
2004-08-18 18:10:27 +00:00
<title > Question Dialog Example</title>
2003-09-01 08:27:59 +00:00
<screenshot >
<mediaobject >
<imageobject >
<imagedata fileref= "figures/zenity-question-screenshot.png" format= "PNG" />
</imageobject>
<textobject >
2004-08-18 18:10:27 +00:00
<phrase > &app; question dialog example</phrase>
2003-09-01 08:27:59 +00:00
</textobject>
</mediaobject>
</screenshot>
</figure>
</sect2>
2003-01-18 18:02:14 +00:00
2004-08-18 18:10:27 +00:00
<sect2 id= "zenity-warning-dialog" >
<title > Warning Dialog</title>
2003-01-18 18:02:14 +00:00
2004-08-18 18:10:27 +00:00
<para >
Use the <option > --warning</option> option to create a warning dialog.
</para>
2003-06-09 18:57:01 +00:00
2004-08-18 18:10:27 +00:00
<para >
The following example script shows how to create a warning dialog:
2003-06-09 18:57:01 +00:00
2004-08-18 18:10:27 +00:00
<programlisting >
#!/bin/bash
zenity --warning \
--text="Disconnect the power cable to avoid electrical shock."
</programlisting>
2003-01-18 18:02:14 +00:00
2004-08-18 18:10:27 +00:00
</para>
2003-01-18 18:02:14 +00:00
2004-08-18 18:10:27 +00:00
<figure id= "zenity-warning-screenshot" >
<title > Warning Dialog Example</title>
<screenshot >
<mediaobject >
<imageobject >
<imagedata fileref= "figures/zenity-warning-screenshot.png" format= "PNG" />
</imageobject>
<textobject >
<phrase > &app; warning dialog example</phrase>
</textobject>
</mediaobject>
</screenshot>
</figure>
</sect2>
2003-09-01 08:27:59 +00:00
2003-01-18 18:02:14 +00:00
</sect1>
2004-08-18 18:10:27 +00:00
<!-- ==== Progress Options ====== -->
2003-01-18 18:02:14 +00:00
2004-08-18 18:10:27 +00:00
<sect1 id= "zenity-progress-options" >
<title > Progress Dialog</title>
2003-01-22 01:50:28 +00:00
<para >
2004-08-18 18:10:27 +00:00
Use the <option > --progress</option> option to create a progress dialog.
2003-01-22 01:50:28 +00:00
</para>
<para >
2004-08-18 18:10:27 +00:00
&app; reads data from standard input line by line. If a line is prefixed with #, the text is updated with the text on that line. If a line contains only a number, the percentage is updated with that number.
2003-09-01 08:27:59 +00:00
</para>
2004-08-18 18:10:27 +00:00
2003-09-01 08:27:59 +00:00
<para >
2004-08-18 18:10:27 +00:00
The progress dialog supports the following options:
2003-01-18 18:02:14 +00:00
</para>
<variablelist >
2004-04-28 12:06:02 +00:00
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --text</option> =<replaceable > text</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the text that is displayed in the progress dialog.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --percentage</option> =<replaceable > percentage</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the initial percentage that is set in the progress dialog.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --auto-close</option> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Closes the progress dialog when 100% has been reached.</para>
2003-01-18 18:02:14 +00:00
</listitem>
2004-07-19 01:01:28 +00:00
</varlistentry>
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --pulsate</option> </term>
2004-07-19 01:01:28 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies that the progress bar pulsates until an EOF character is read from standard input.</para>
2004-07-19 01:01:28 +00:00
</listitem>
2003-01-18 18:02:14 +00:00
</varlistentry>
</variablelist>
2003-09-01 08:27:59 +00:00
<para >
2004-08-18 18:10:27 +00:00
The following example script shows how to create a progress dialog:
<programlisting >
#!/bin/sh
(
echo "10" ; sleep 1
echo "# Updating mail logs" ; sleep 1
echo "20" ; sleep 1
echo "# Resetting cron jobs" ; sleep 1
echo "50" ; sleep 1
echo "This line will just be ignored" ; sleep 1
echo "75" ; sleep 1
echo "# Rebooting system" ; sleep 1
echo "100" ; sleep 1
) |
zenity --progress \
--title="Update System Logs" \
--text="Scanning mail logs..." \
--percentage=0
if [ "$?" = -1 ] ; then
zenity --error \
--text="Update canceled."
fi
</programlisting>
2003-09-01 08:27:59 +00:00
</para>
2004-08-18 18:10:27 +00:00
<figure id= "zenity-progress-screenshot" >
<title > Progress Dialog Example</title>
2003-01-18 19:04:26 +00:00
<screenshot >
<mediaobject >
<imageobject >
2004-08-18 18:10:27 +00:00
<imagedata fileref= "figures/zenity-progress-screenshot.png" format= "PNG" />
2003-01-18 19:04:26 +00:00
</imageobject>
<textobject >
2004-08-18 18:10:27 +00:00
<phrase > &app; progress dialog example</phrase>
2003-01-18 19:04:26 +00:00
</textobject>
</mediaobject>
</screenshot>
</figure>
2003-01-18 18:02:14 +00:00
</sect1>
2004-08-18 18:10:27 +00:00
<!-- ==== Text Entry Options ====== -->
2003-01-18 18:02:14 +00:00
2004-08-18 18:10:27 +00:00
<sect1 id= "zenity-text-entry-options" >
<title > Text Entry Dialog</title>
2003-09-01 08:27:59 +00:00
<para >
2004-08-18 18:10:27 +00:00
Use the <option > -entry</option> option to create a text entry dialog. &app; returns the contents of the text entry to standard error.
</para>
<para >
The text entry dialog supports the following options:
2003-01-18 18:02:14 +00:00
</para>
<variablelist >
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --text</option> =<replaceable > text</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the text that is displayed in the text entry dialog.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --entry-text</option> =<replaceable > text</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies the text that is displayed in the entry field of the text entry dialog.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
2003-06-03 21:52:16 +00:00
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --hide-text</option> </term>
2003-06-03 21:52:16 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Hides the text in the entry field of the text entry dialog.</para>
2003-01-18 18:02:14 +00:00
</listitem>
2003-01-19 12:31:13 +00:00
</varlistentry>
2003-01-18 18:02:14 +00:00
</variablelist>
2003-01-22 01:50:28 +00:00
<para >
2004-08-18 18:10:27 +00:00
The following example script shows how to create a text entry dialog:
<programlisting >
#!/bin/sh
if zenity --entry \
--title="Add an Entry" \
--text="Enter your _password:" \
--entry-text "password" \
--hide-text
then echo $?
else echo "No password entered"
fi
</programlisting>
2003-01-22 01:50:28 +00:00
</para>
2003-01-18 18:02:14 +00:00
2004-08-18 18:10:27 +00:00
<figure id= "zenity-entry-screenshot" >
<title > Text Entry Dialog Example</title>
2003-09-01 08:27:59 +00:00
<screenshot >
<mediaobject >
<imageobject >
2004-08-18 18:10:27 +00:00
<imagedata fileref= "figures/zenity-entry-screenshot.png" format= "PNG" />
2003-09-01 08:27:59 +00:00
</imageobject>
<textobject >
2004-08-18 18:10:27 +00:00
<phrase > &app; text entry dialog example</phrase>
2003-09-01 08:27:59 +00:00
</textobject>
</mediaobject>
</screenshot>
</figure>
2003-01-18 18:02:14 +00:00
</sect1>
<!-- ==== Text Information Options ====== -->
<sect1 id= "zenity-text-options" >
2003-09-01 08:27:59 +00:00
<title > Text Information Dialog</title>
2003-01-18 18:02:14 +00:00
<para >
2004-08-18 18:10:27 +00:00
Use the <option > --text-info</option> option to create a text information dialog.
2003-01-22 01:50:28 +00:00
</para>
<para >
2004-08-18 18:10:27 +00:00
The text information dialog supports the following options:
2003-01-18 18:02:14 +00:00
</para>
<variablelist >
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --filename</option> =<replaceable > filename</replaceable> </term>
2003-01-18 18:02:14 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Specifies a file that is loaded in the text information dialog.</para>
2003-01-18 18:02:14 +00:00
</listitem>
</varlistentry>
2003-01-19 12:13:08 +00:00
<varlistentry >
2004-08-18 18:10:27 +00:00
<term > <option > --editable</option> </term>
2003-01-19 12:13:08 +00:00
<listitem >
2004-08-18 18:10:27 +00:00
<para > Allows the displayed text to be edited. The edited text is returned to standard error when the dialog is closed.</para>
2003-01-19 12:13:08 +00:00
</listitem>
</varlistentry>
2003-01-18 18:02:14 +00:00
</variablelist>
2003-01-22 01:50:28 +00:00
<para >
2004-08-18 18:10:27 +00:00
The following example script shows how to create a text information dialog:
<programlisting >
#!/bin/sh
FILE=`zenity --file-selection \
--title="Select a File"`
case $? in
0)
zenity --text-info \
--title=$FILE \
--filename=$FILE \
--editable 2>/tmp/tmp.txt;;
1)
echo "No file selected.";;
-1)
echo "No file selected.";;
esac
</programlisting>
2003-01-22 01:50:28 +00:00
</para>
2003-01-18 18:02:14 +00:00
2003-09-01 08:27:59 +00:00
<figure id= "zenity-text-screenshot" >
2004-08-18 18:10:27 +00:00
<title > Text Information Dialog Example</title>
2003-09-01 08:27:59 +00:00
<screenshot >
<mediaobject >
<imageobject >
<imagedata fileref= "figures/zenity-text-screenshot.png" format= "PNG" />
</imageobject>
<textobject >
2004-08-18 18:10:27 +00:00
<phrase > &app; text information dialog example</phrase>
2003-09-01 08:27:59 +00:00
</textobject>
</mediaobject>
</screenshot>
</figure>
2003-01-18 18:02:14 +00:00
</sect1>
2003-01-15 10:28:19 +00:00
</article>