<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "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">
]>
<!-- ================ Document Header ================= -->
<article id="index" lang="gl">

  <articleinfo>
    <title>Manual de Zenity</title>
    <subtitle>Manual do aplicativo de escritorio Zenity V2.0</subtitle>
    <copyright>
	    <year>2003</year>
	    <year>2004</year>
	    <holder>Sun Microsystems, Inc.</holder>
    </copyright><copyright><year>2011.</year><holder>Fran Dieguez (frandieguez@gnome.org)</holder></copyright>

    <!-- Translators: uncomment this
    <copyright>
	    <year>2004</year>
	    <holder>ME_THE_TRANSLATOR</holder>
    </copyright>
    -->

    <publisher>
	    <publishername>Sun Microsystems, Inc.</publishername>
    </publisher>

      <legalnotice id="legalnotice">
	<para>Pode copiar, distribuír e modificar este documento baixo os termos da Licenza de Documentación Libre GNU (GFDL) na súa versión 1.1 ou posterior, publicada pola Free Software Foundation, sen seccións invariantes e sen textos de portada ou de contraportada. Pode atopar unha copia da GFDL en <ulink type="help" url="ghelp:fdl">link</ulink> ou no ficheiro COPYING-DOCS distribuído xunto con este manual.</para>
         <para>Este manual é parte da colección de manuais de GNOME distribuidos baixo a licenza GFDL. Se quere distribuír este manual de forma separada da colección pode facelo engadindo unha copia da licenza xunto ao manual, como se describe na sección 6 da licenza.</para>

	<para>Moitos dos nomes usados polas empresas para distinguir os seus produtos e servizos son declaradas como marcas rexistradas. Onde esos nomes aparecen na calquera documentación de GNOME, e os membros do Proxecto de documentación de GNOME fanse saber desas marcas rexistradas, polo tanto os nomes están en maiúsculas ou a letra inicial en maiúsculas.</para>

	<para>
	  DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED
	  UNDER  THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE
	  WITH THE FURTHER UNDERSTANDING THAT:

	  <orderedlist>
		<listitem>
		  <para>DOCUMENT IS PROVIDED ON AN "AS IS" BASIS,
                    WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
                    IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
                    THAT THE DOCUMENT OR MODIFIED VERSION OF THE
                    DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR
                    A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
                    RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE
                    OF THE DOCUMENT OR MODIFIED VERSION OF THE
                    DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR
                    MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT,
                    YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY
                    CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
                    SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
                    OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
                    LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED
                    VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER
                    EXCEPT UNDER THIS DISCLAIMER; AND
		  </para>
		</listitem>
		<listitem>
		  <para>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL
                       THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE),
                       CONTRACT, OR OTHERWISE, SHALL THE AUTHOR,
                       INITIAL WRITER, ANY CONTRIBUTOR, OR ANY
                       DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION
                       OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH
                       PARTIES, BE LIABLE TO ANY PERSON FOR ANY
                       DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
                       CONSEQUENTIAL DAMAGES OF ANY CHARACTER
                       INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS
                       OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
                       MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR
                       LOSSES ARISING OUT OF OR RELATING TO USE OF THE
                       DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT,
                       EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF
                       THE POSSIBILITY OF SUCH DAMAGES.
		  </para>
		</listitem>
	  </orderedlist>
	</para>
  </legalnotice>



    <authorgroup>
      <author>
        <firstname>Sun</firstname>
        <surname>Equipo de documentación do escritorio de Java Desktop System</surname>
        <affiliation><orgname>Sun Microsystems, Inc.</orgname></affiliation>
      </author>
      <author role="maintainer">
        <firstname>Glynn</firstname>
        <surname>Foster</surname>
        <affiliation>
          <orgname>Proxecto de documentación de GNOME</orgname>
        </affiliation>
      </author>
      <editor>
        <firstname>Nicholas</firstname>
        <surname>Curran</surname>
        <affiliation>
          <orgname>Proxecto de documentación de GNOME</orgname>
        </affiliation>
      </editor>
    </authorgroup>

    <revhistory>
      <revision>
        <revnumber>Manual do aplicativo de escritorio Zenity V2.0</revnumber>
        <date>Agosto de 2004</date>
        <revdescription>
          <para role="author">Equipo de documentación do escritorio de Sun Java Desktop System</para>
          <para role="publisher">Sun Microsystems, Inc.</para>
        </revdescription>
      </revision>

      <revision>
        <revnumber>Manual de Zenity V1.0</revnumber>
        <date>Xaneiro de 2003</date>
        <revdescription>
          <para role="author">Glynn Foster</para>
          <para role="publisher">Proxecto de documentación de GNOME</para>
        </revdescription>
      </revision>
    </revhistory>

    <releaseinfo>Este manual describe a versión 2.6.0 de Zenity.</releaseinfo>

    <legalnotice>
	    <title>Comentarios e suxestións</title>
	    <para>Para enviar comentarios, siga as direccións da <ulink url="ghelp:gnome-feedback" type="help">páxina de comentarios</ulink>.</para>
<!-- Translators may also add here feedback address for translations -->

    </legalnotice>
    <abstract role="description">
            <para>Zenity é unha rescritura de gdialog, o «port» de GNOME de dialog que lle permite mostrar caixas de diálogo desde a liña de ordes e scripts de shell.</para>
    </abstract>
  </articleinfo>
  
  <indexterm>
    <primary>orde zenity</primary>
  </indexterm>
  <indexterm>
    <primary>creador de diálogos</primary>
  </indexterm>
<!-- ================ Document Body ================= -->

<!-- ==== Introduction ====== -->

  <sect1 id="zenity-introduction">
    <title>Introdución</title>

    <para><application>Zenity</application> permítelle crear os seguintes tipos de diálogos sinxelos:</para>

    <itemizedlist>
        <listitem><para>Calendario</para></listitem>
	<listitem><para>Seleccionador de ficheiros</para></listitem>
	<listitem><para>Lista</para></listitem>
	<listitem><para>Icona de notificación</para></listitem>
        <listitem><para>Mensaxe</para>
            <itemizedlist>
	        <listitem><para>Erro</para></listitem>
		<listitem><para>Información</para></listitem>
		<listitem><para>Pregunta</para></listitem>
		<listitem><para>Advertencia</para></listitem>
	    </itemizedlist>
	</listitem>
	<listitem><para>Progreso</para></listitem>
        <listitem><para>Entrada de texto</para></listitem>
	<listitem><para>Información de texto</para></listitem>
    </itemizedlist>

  </sect1>

<!-- ==== Usage ====== -->

  <sect1 id="zenity-usage">
    <title>Uso</title>

    <para>
	When you write scripts, you can use <application>Zenity</application> to create simple dialogs that interact graphically with the user, as follows:
    </para>
    <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>
    <para>
	When the user closes the dialog, <application>Zenity</application> prints the text produced by the dialog to standard output.
    </para>

    <note>
      <para>
        When you write <application>Zenity</application> 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>Combinacións de teclas</title>
	<para>
	  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.
	</para>
	<para>
          Some <application>Zenity</application> 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>"_Seleccione un nome".</userinput></screen>
    </sect2>

    <sect2 id="zenity-usage-exitcodes">
      <title>Códigos de saída</title>
    <para><application>Zenity</application> retorna os seguintes códigos de erro:</para>

    <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>Código de saída</para></entry>
            <entry colname="COLSPEC1">
              <para>Descrición</para></entry>
          </row>
        </thead>
        <tbody>
          <row valign="top">
            <entry>
              <para><varname>0</varname></para>
            </entry>
            <entry>
              <para>O usuario premeu ou <guibutton>Aceptar</guibutton> ou <guibutton>Pechar</guibutton>.</para>
            </entry>
          </row>
          <row valign="top">
            <entry>
              <para><varname>1</varname></para>
            </entry>
            <entry>
              <para>O usuario premeu ou <guibutton>Cancelar</guibutton> ou usou as funcións de xanela para pechar o diálogo.</para>
            </entry>
          </row>
          <row valign="top">
            <entry>
              <para><varname>-1</varname></para>
            </entry>
            <entry>
              <para>Produciuse un erro inesperado.</para>
            </entry>
          </row>
          <row valign="top">
            <entry>
              <para><varname>5</varname></para>
            </entry>
            <entry>
              <para>O diálogo pechouse porque o tempo de espera alcanzouse.</para>
            </entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>

    </sect2>


  <!-- ==== General Options ====== -->

  <sect2 id="zenity-usage-general-options">
    <title>Opcións xerais</title>

    <para>Tódolos diálogos de <application>Zenity</application> son compatíbeis coas seguintes opcións xerais:</para>

    <variablelist>

      <varlistentry>
        <term><option>--title</option>=<replaceable>título</replaceable></term>
	<listitem>
	  <para>Especifica o título dun diálogo.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--window-icon</option>=<replaceable>ruta_de_icona</replaceable></term>
	<listitem>
	  <para>Especifica a icona que se mostra no marco da xanela do diálogo. Hai 4 iconas dispoñíbeis, fornecendo as palabras chave seguintes - «info», «warning», «question» e «erro».</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--width</option>=<replaceable>ancho</replaceable></term>
	<listitem>
	  <para>Especifica o ancho dun diálogo</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--height</option>=<replaceable>alto</replaceable></term>
	<listitem>
	  <para>Especifica o alto dun diálogo</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--timeout</option>=<replaceable>tempo de espera</replaceable></term>
	<listitem>
	  <para>Especifica o tempo de espera en segundos despois do cal o diálogo se pechará.</para>
	</listitem>
      </varlistentry>

    </variablelist>

  </sect2>

<!-- ==== Miscellaneous Options ====== -->

  <sect2 id="zenity-help-options">
    <title>Opcións de axuda</title>

    <para><application>Zenity</application> fornece as seguintes opcións de axuda</para>

    <variablelist>

      <varlistentry>
        <term><option>--help</option></term>
	<listitem>
	  <para>Mostra un texto de axuda abreviado.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--help-all</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para os diálogos</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-general</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións de diálogo xerais.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-calendar</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións do diálogo do calendario.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-entry</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións do diálogo de entrada de texto.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-error</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións do diálogo de erro.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-info</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións do diálogo de información.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-file-selection</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións do diálogo de selección de ficheiros.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-list</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións do diálogo de lista.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-notification</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións de iconas de notificación.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-progress</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións do diálogo de progreso.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-question</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións do diálogo de pregunta.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-warning</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións do diálogo de avisos.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-text-info</option></term>
	<listitem>
	  <para>Mostra o texto de axuda para as opcións de diálogo de información.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-misc</option></term>
	<listitem>
	  <para>Mostra axuda para opcións varias.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-gtk</option></term>
	<listitem>
	  <para>Mostra axuda para as opcóns de GTK+</para>
	</listitem>
      </varlistentry>
 
    </variablelist>

  </sect2>

<!-- ==== Miscellaneous Options ====== -->

  <sect2 id="zenity-miscellaneous-options">
    <title>Opcións varias</title>

    <para><application>Zenity</application> tamén fornece as seguintes opcións varias:</para>

    <variablelist>

      <varlistentry>
        <term><option>--about</option></term>
	<listitem>
	  <para>Mostra o diálogo <guilabel>Sobre Zenity</guilabel>, que contén información da versión de <application>Zenity</application>, información de copyright e información do desenvolvedor.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--version</option></term>
	<listitem>
	  <para>Mostra o número de versión de <application>Zenity</application>.</para>
	</listitem>
      </varlistentry>

    </variablelist>

  </sect2>

<!-- ==== GTK+ Options ====== -->

  <sect2 id="zenity-gtk-options">
    <title>Opcións de GTK+</title>

    <para><application>Zenity</application> admite as opcións GTK+ estándar. Para obter máis información sobre as opcións de GTK+, execute a orde <command>zenity -?</command>.</para>

  </sect2>

<!-- ==== Environment variables ==== -->

  <sect2 id="zenity-environment-variables">
    <title>Variábeis de contorno</title>

    <para>
      Normally, <application>Zenity</application> detects the terminal window from which it was launched
      and keeps itself above that window.  This behavior can be disabled by
      unsetting the <envar>WINDOWID</envar> environment variable.
    </para>

  </sect2>

  </sect1>
<!-- ==== Calendar Options ====== -->

  <sect1 id="zenity-calendar-options">
    <title>Diálogo de calendario</title>

    <para>Use a opción <option>--calendar</option> para crear un diálogo de calendario. <application>Zenity</application> devolve a data seleccionada á entrada estándar. Se non se selecciona ningunha data na liña de ordes, o diálogo use a data actual.</para>
    <para>O diálogo de calendario admite as seguintes opcións:</para>

    <variablelist>

      <varlistentry>
        <term><option>--text</option>=<replaceable>texto</replaceable></term>
	<listitem>
	  <para>Especifica o texto que se mostra no diálogo de calendario.</para>
	</listitem>
      </varlistentry>
     	
      <varlistentry>
        <term><option>--day</option>=<replaceable>día</replaceable></term>
	<listitem>
	  <para>Especifica o día que está seleccionado no diálogo de calendario. <replaceable>día</replaceable> debe ser un número entre 1 e 31 ámbolos dous incluídos.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--month</option>=<replaceable>mes</replaceable></term>
	<listitem>
	  <para>Especifica o mes que está seleccionado no diálogo de calendario. <replaceable>mes</replaceable> debe ser un número entre 1 e 12 ámbolos dous incluídos.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--year</option>=<replaceable>ano</replaceable></term>
	<listitem>
	  <para>Especifica o ano que está seleccionado no diálogo de calendario.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--date-format</option>=<replaceable>formato</replaceable></term>
	<listitem>
	  <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>.
	  </para>
	</listitem>
      </varlistentry>

    </variablelist>

    <para>O seguinte script de exemplo mostra como se crea un diálogo de calendario: <programlisting>
        #!/bin/sh


        if zenity --calendar \
        --title="Seleccione unha data" \
        --text="Prema nunha data para seleccionala." \
        --day=10 --month=8 --year=2004
          then echo $?
          else echo "Non se seleccionou ningunha data"
        fi
      </programlisting></para>

    <figure id="zenity-calendar-screenshot">
      <title>Diálogo de calendario de exemplo</title>
      <screenshot>
        <mediaobject>
          <imageobject>
              <imagedata fileref="figures/zenity-calendar-screenshot.png" format="PNG"/>
          </imageobject>
          <textobject>
              <phrase><application>Zenity</application> exemplo dun diálogo de calendario</phrase>
          </textobject>
        </mediaobject>
      </screenshot>
   </figure>
													  
  </sect1>


<!-- ==== File Selection Options ====== -->

  <sect1 id="zenity-file-selection-options">
    <title>Diálogo de selección de ficheiro</title>

    <para>
	Use the <option>--file-selection</option> option to create a file selection dialog. <application>Zenity</application> returns the selected files or directories to standard 
        output. The default mode of the file selection dialog is open.
    </para>
    <para>O diálogo de selección de ficheiros admite as seguintes opcións:</para>

    <variablelist>

      <varlistentry>
        <term><option>--filename</option>=<replaceable>filename</replaceable></term>
	<listitem>
	  <para>Specifies the file or directory that is selected in the file selection dialog when the dialog is first shown.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--multiple</option></term>
	<listitem>
	  <para>Permite a selección de múltiples nomes de ficheiro no diálogo de selección de ficheiro.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--directory</option></term>
	<listitem>
	  <para>Permite só a selección de cartafoles no diálogo de selección de ficheiro.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--save</option></term>
	<listitem>
	  <para>Estabelece o diálogo de selección de modo no modo gardar.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--separator</option>=<replaceable>separador</replaceable></term>
	<listitem>
	  <para>Especifica a cadea que se usará para dividir a lista de nomes de ficheiro devolta.</para>
	</listitem>
      </varlistentry>

    </variablelist>

    <para>O seguinte script de exemplo mostra como crear un diálogo de selección de ficheiro: <programlisting>
        #!/bin/sh

        FILE=`zenity --file-selection --title="Seleccione un ficheiro"`

        case $? in
                 0)
                        echo "\"$FILE\" seleccionado.";;
                 1)
                        echo "Non se seleccionou ningún ficheiro.";;
                -1)
                        echo "Non se seleccionou ningún ficheiro.";;
        esac
      </programlisting></para>

    <figure id="zenity-fileselection-screenshot">
      <title>Exemplo de diálogo de selección de ficheiros</title>
      <screenshot>
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/zenity-fileselection-screenshot.png" format="PNG"/>
	  </imageobject>
	  <textobject>
	    <phrase><application>Zenity</application> exemplo de selección de ficheiro</phrase>
	  </textobject>
        </mediaobject>
      </screenshot>
    </figure>

  </sect1>

<!-- ==== Notification Options ====== -->
  <sect1 id="zenity-notification-options">
    <title>Icona de notificación</title>

    <para>
    </para>

    <variablelist>

      <varlistentry>
        <term><option>--text</option>=<replaceable>texto</replaceable></term>
	<listitem>
	  <para>Especifica o texto que se mostra na área de notificación.</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="Non hai anovacións do sistema necesarios!"
      </programlisting>

    </para>

    <figure id="zenity-notification-screenshot">
      <title>Exemplo de icona de notificación</title>
      <screenshot>
        <mediaobject>
          <imageobject>
              <imagedata fileref="figures/zenity-notification-screenshot.png" format="PNG"/>
          </imageobject>
          <textobject>
              <phrase><application>Zenity</application> exemplo da icona de notificación</phrase>
          </textobject>
        </mediaobject>
      </screenshot>
   </figure>
													  
  </sect1>

<!-- ==== List Options ====== -->

  <sect1 id="zenity-list-options">
    <title>Diálogo de lista</title>

    <para>
	Use the <option>--list</option> option to create a list dialog. <application>Zenity</application> returns the entries in the first column of text of selected rows to standard output.
    </para>

    <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>O diálogo de lista admite as seguintes opcións:</para>

    <variablelist>

      <varlistentry>
        <term><option>--columna</option>=<replaceable>columna</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>Especifica que a primeira columna no diálogo de lista contén caixas de verificación.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--radiolist</option></term>
	<listitem>
	  <para>Especifica que a primeira columna no diálogo de lista contén caixas de opción.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--editable</option></term>
	<listitem>
	  <para>permite editar os elementos mostrados.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--separator</option>=<replaceable>separador</replaceable></term>
	<listitem>
	  <para>Specifies what string is used when the list dialog returns the selected entries.
	  </para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--print-column</option>=<replaceable>columna</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>

    </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>Exemplo de diálogo de lista</title>
      <screenshot>
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/zenity-list-screenshot.png" format="PNG"/>
	  </imageobject>
	  <textobject>
	    <phrase><application>Zenity</application> list dialog example</phrase>
	  </textobject>
        </mediaobject>
      </screenshot>
    </figure>

  </sect1>

<!-- ==== Message Options ====== -->

  <sect1 id="zenity-message-options">
    <title>Message Dialogs</title>

    <para>
        <application>Zenity</application> can create four types of message dialog: 
    </para>
    <itemizedlist>
      <listitem>
        <para>Erro</para>
      </listitem>
      <listitem>
        <para>Información</para>
      </listitem>
      <listitem>
        <para>Pregunta</para>
      </listitem>
      <listitem>
        <para>Advertencia</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>

      <para>
          Use the <option>--error</option> option to create an error dialog.  
      </para>

      <para>
        The following example script shows how to create an error dialog:

        <programlisting>
          #!/bin/bash

          zenity --error \
          --text="Could not find /var/log/syslog."
        </programlisting>

      </para>

      <figure id="zenity-error-screenshot">
        <title>Error Dialog Example</title>
        <screenshot>
          <mediaobject>
            <imageobject>
              <imagedata fileref="figures/zenity-error-screenshot.png" format="PNG"/>
	    </imageobject>
	    <textobject>
	      <phrase><application>Zenity</application> error dialog example</phrase>
	    </textobject>
          </mediaobject>
        </screenshot>
      </figure>
    </sect2>

    <sect2 id="zenity-info-dialog">
      <title>Information Dialog</title>

      <para>
          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>

      </para>

      <figure id="zenity-information-screenshot">
        <title>Information Dialog Example</title>
        <screenshot>
          <mediaobject>
            <imageobject>
              <imagedata fileref="figures/zenity-information-screenshot.png" format="PNG"/>
	    </imageobject>
	    <textobject>
	      <phrase><application>Zenity</application> information dialog example</phrase>
	    </textobject>
          </mediaobject>
        </screenshot>
      </figure>
    </sect2>

    <sect2 id="zenity-question-dialog">
      <title>Question Dialog</title>

      <para>
          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>

      </para>

      <figure id="zenity-question-screenshot">
        <title>Exemplo do diálogo de pregunta</title>
        <screenshot>
          <mediaobject>
            <imageobject>
              <imagedata fileref="figures/zenity-question-screenshot.png" format="PNG"/>
	    </imageobject>
	    <textobject>
	      <phrase><application>Zenity</application> exemplo do diálogo de pregunta</phrase>
	    </textobject>
          </mediaobject>
        </screenshot>
      </figure>
    </sect2>

    <sect2 id="zenity-warning-dialog">
      <title>Diálogo de advertencia</title>

      <para>Use a opción <option>--warning</option> para crear un diálogo de pregunta.</para>

      <para>
        The following example script shows how to create a warning dialog:

        <programlisting>
          #!/bin/bash
        
          zenity --warning \
          --text="Disconnect the power cable to avoid electrical shock."
        </programlisting>

      </para>

      <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><application>Zenity</application> warning dialog example</phrase>
	    </textobject>
          </mediaobject>
        </screenshot>
      </figure>
    </sect2>

  </sect1>

<!-- ==== Progress Options ====== -->

  <sect1 id="zenity-progress-options">
    <title>Diálogo de progreso</title>

    <para>
	Use the <option>--progress</option> option to create a progress dialog. 
    </para>

    <para>
      <application>Zenity</application> 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.
    </para>
	
    <para>
	The progress dialog supports the following options:
    </para>

    <variablelist>

      <varlistentry>
        <term><option>--text</option>=<replaceable>texto</replaceable></term>
	<listitem>
	  <para>Specifies the text that is displayed in the progress dialog.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--percentage</option>=<replaceable>percentage</replaceable></term>
	<listitem>
	  <para>Specifies the initial percentage that is set in the progress dialog.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--auto-close</option></term>
	<listitem>
	  <para>Closes the progress dialog when 100% has been reached.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--pulsate</option></term>
	<listitem>
	  <para>Specifies that the progress bar pulsates until an EOF character is read from standard input.</para>
	</listitem>
      </varlistentry>

    </variablelist>

    <para>
      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>

    </para>

    <figure id="zenity-progress-screenshot">
      <title>Progress Dialog Example</title>
      <screenshot>
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/zenity-progress-screenshot.png" format="PNG"/>
	  </imageobject>
	  <textobject>
	    <phrase><application>Zenity</application> progress dialog example</phrase>
	  </textobject>
        </mediaobject>
      </screenshot>
    </figure>

  </sect1>

<!-- ==== Text Entry Options ====== -->

  <sect1 id="zenity-text-entry-options">
    <title>Text Entry Dialog</title>

    <para>
        Use the <option>--entry</option> option to create a text entry dialog. <application>Zenity</application> returns the contents of the text entry to standard output. 
    </para>	
    <para>	
	The text entry dialog supports the following options:
    </para>

    <variablelist>

      <varlistentry>
        <term><option>--text</option>=<replaceable>texto</replaceable></term>
	<listitem>
	  <para>Specifies the text that is displayed in the text entry dialog.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--entry-text</option>=<replaceable>text</replaceable></term>
	<listitem>
	  <para>Specifies the text that is displayed in the entry field of the text entry dialog.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--hide-text</option></term>
	<listitem>
	  <para>Hides the text in the entry field of the text entry dialog.</para>
	</listitem>
      </varlistentry>

    </variablelist>

    <para>
      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>

    </para>

    <figure id="zenity-entry-screenshot">
      <title>Text Entry Dialog Example</title>
      <screenshot>
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/zenity-entry-screenshot.png" format="PNG"/>
	  </imageobject>
	  <textobject>
	    <phrase><application>Zenity</application> text entry dialog example</phrase>
	  </textobject>
        </mediaobject>
      </screenshot>
    </figure>
  </sect1>

<!-- ==== Text Information Options ====== -->

  <sect1 id="zenity-text-options">
    <title>Text Information Dialog</title>

    <para>
	Use the <option>--text-info</option> option to create a text information dialog. 
    </para>
	
    <para>
	The text information dialog supports the following options:
    </para>

    <variablelist>

      <varlistentry>
        <term><option>--filename</option>=<replaceable>filename</replaceable></term>
	<listitem>
	  <para>Specifies a file that is loaded in the text information dialog.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--editable</option></term>
        <listitem>
          <para>Allows the displayed text to be edited. The edited text is returned to standard output when the dialog is closed.</para>
        </listitem>
      </varlistentry>

    </variablelist>

    <para>
      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&gt;/tmp/tmp.txt;;
                 1)
                        echo "No file selected.";;
                -1)
                        echo "No file selected.";;
        esac
      </programlisting>

    </para>

    <figure id="zenity-text-screenshot">
      <title>Text Information Dialog Example</title>
      <screenshot>
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/zenity-text-screenshot.png" format="PNG"/>
	  </imageobject>
	  <textobject>
	    <phrase><application>Zenity</application> text information dialog example</phrase>
	  </textobject>
        </mediaobject>
      </screenshot>
    </figure>

  </sect1>

</article>
