<?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>MateDialog</application>">
<!ENTITY appname "MateDialog">
<!ENTITY date "August 2004">
<!ENTITY manrevision "2.0">
]>
<!-- ================ Document Header ================= -->
<article id="index" lang="en_GB">

  <articleinfo>
    <title>MateDialog Manual</title>
    <subtitle>MateDialog Desktop Application Manual V2.0</subtitle>
    <copyright>
	    <year>2003</year>
	    <year>2004</year>
	    <holder>Sun Microsystems, Inc.</holder>
    </copyright><copyright><year>2007</year><holder>David Lodge (dave@cirt.net)</holder></copyright><copyright><year>2009</year><holder>Jen Ockwell (jenfraggleubuntu@gmail.com)</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>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation Licence (GFDL), Version 1.1 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You can find a copy of the GFDL at this <ulink type="help" url="ghelp:fdl">link</ulink> or in the file COPYING-DOCS distributed with this manual.</para>
         <para>This manual is part of a collection of MATE manuals distributed under the GFDL. If you want to distribute this manual separately from the collection, you can do so by adding a copy of the license to the manual, as described in section 6 of the licence.</para>

	<para>Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any MATE documentation, and the members of the MATE Documentation Project are made aware of those trademarks, then the names are in capital letters or initial capital letters.</para>

	<para>DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENCE 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 LICENCE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS AUTHORISED 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>Java Desktop System Documentation Team</surname>
        <affiliation><orgname>Sun Microsystems, Inc.</orgname></affiliation>
      </author>
      <author role="maintainer">
        <firstname>Glynn</firstname>
        <surname>Foster</surname>
        <affiliation>
          <orgname>MATE Documentation Project</orgname>
        </affiliation>
      </author>
      <editor>
        <firstname>Nicholas</firstname>
        <surname>Curran</surname>
        <affiliation>
          <orgname>MATE Documentation Project</orgname>
        </affiliation>
      </editor>
    </authorgroup>

    <revhistory>
      <revision>
        <revnumber>MateDialog Desktop Application Manual V2.0</revnumber>
        <date>August 2004</date>
        <revdescription>
          <para role="author">Sun Java Desktop System Documentation Team</para>
          <para role="publisher">Sun Microsystems, Inc.</para>
        </revdescription>
      </revision>

      <revision>
        <revnumber>MateDialog Manual V1.0</revnumber>
        <date>January 2003</date>
        <revdescription>
          <para role="author">Glynn Foster</para>
          <para role="publisher">MATE Documentation Project</para>
        </revdescription>
      </revision>
    </revhistory>

    <releaseinfo>This manual describes version 2.6.0 of MateDialog.</releaseinfo>

    <legalnotice>
	    <title>Feedback</title>
	    <para>To send feedback, follow the directions in the <ulink url="ghelp:mate-feedback" type="help">Feedback Page</ulink>.</para>
<!-- Translators may also add here feedback address for translations -->

    </legalnotice>
    <abstract role="description">
            <para>MateDialog is a rewrite of gdialog, the MATE port of dialog which allows you to display dialogue boxes from the command line and shell scripts.</para>
    </abstract>
  </articleinfo>
  
  <indexterm>
    <primary>matedialog command</primary>
  </indexterm>
  <indexterm>
    <primary>dialogue creator</primary>
  </indexterm>
<!-- ================ Document Body ================= -->

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

  <sect1 id="matedialog-introduction">
    <title>Introduction</title>

    <para><application>MateDialog</application> enables you to create the following types of simple dialogue:</para>

    <itemizedlist>
        <listitem><para>Calendar</para></listitem>
	<listitem><para>File selection</para></listitem>
	<listitem><para>List</para></listitem>
	<listitem><para>Notification icon</para></listitem>
        <listitem><para>Message</para>
            <itemizedlist>
	        <listitem><para>Error</para></listitem>
		<listitem><para>Information</para></listitem>
		<listitem><para>Question</para></listitem>
		<listitem><para>Warning</para></listitem>
	    </itemizedlist>
	</listitem>
	<listitem><para>Progress</para></listitem>
        <listitem><para>Text entry</para></listitem>
	<listitem><para>Text information</para></listitem>
    </itemizedlist>

  </sect1>

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

  <sect1 id="matedialog-usage">
    <title>Usage</title>

    <para>When you write scripts, you can use <application>MateDialog</application> to create simple dialogues that interact graphically with the user, as follows:</para>
    <itemizedlist>
      <listitem>
        <para>You can create a dialogue to obtain information from the user. For example, you can prompt the user to select a date from a calendar dialogue, or to select a file from a file selection dialogue.</para>
      </listitem>
      <listitem>
        <para>You can create a dialogue to provide the user with information. For example, you can use a progress dialogue to indicate the current status of an operation, or use a warning message dialogue to alert the user.</para>
      </listitem>
    </itemizedlist>
    <para>
	When the user closes the dialog, <application>MateDialog</application> prints the text produced by the dialog to standard output.
    </para>

    <note>
      <para>When you write <application>MateDialog</application> commands, ensure that you place quotation marks around each argument.</para>
      <para>For example, use: <screen><userinput><command>matedialog --calendar --title="Holiday Planner"</command></userinput></screen> Do not use: <screen><userinput><command>matedialog --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="matedialog-usage-mnemonics">
      <title>Access Keys</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 dialogue. Each access key is identified by an underlined letter on a menu or dialogue option.</para>
	<para>Some <application>MateDialog</application> dialogues 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 dialogue. The following example shows how to specify the letter 'C' as the access key:</para>
	<screen><userinput>"_Choose a name".</userinput></screen>
    </sect2>

    <sect2 id="matedialog-usage-exitcodes">
      <title>Exit Codes</title>
    <para><application>MateDialog</application> returns the following exit codes:</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>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 dialogue.</para>
            </entry>
          </row>
          <row valign="top">
            <entry>
              <para><varname>-1</varname></para>
            </entry>
            <entry>
              <para>An unexpected error has occurred.</para>
            </entry>
          </row>
          <row valign="top">
            <entry>
              <para><varname>5</varname></para>
            </entry>
            <entry>
              <para>The dialogue has been closed because the timeout has been reached.</para>
            </entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>

    </sect2>


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

  <sect2 id="matedialog-usage-general-options">
    <title>General Options</title>

    <para>All <application>MateDialog</application> dialogues support the following general options:</para>

    <variablelist>

      <varlistentry>
        <term><option>--title</option>=<replaceable>title</replaceable></term>
	<listitem>
	  <para>Specifies the title of a dialogue.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--window-icon</option>=<replaceable>icon_path</replaceable></term>
	<listitem>
	  <para>Specifies the icon that is displayed in the window frame of the dialogue. There are 4 stock icons also available by providing the following keywords - 'info', 'warning', 'question' and 'error'.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--width</option>=<replaceable>width</replaceable></term>
	<listitem>
	  <para>Specifies the width of the dialogue.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--height</option>=<replaceable>height</replaceable></term>
	<listitem>
	  <para>Specifies the height of the dialogue.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--timeout</option>=<replaceable>timeout</replaceable></term>
	<listitem>
	  <para>Specifies the timeout in seconds after which the dialogue is closed.</para>
	</listitem>
      </varlistentry>

    </variablelist>

  </sect2>

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

  <sect2 id="matedialog-help-options">
    <title>Help Options</title>

    <para><application>MateDialog</application> provides the following help options:</para>

    <variablelist>

      <varlistentry>
        <term><option>--help</option></term>
	<listitem>
	  <para>Displays shortened help text.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--help-all</option></term>
	<listitem>
	  <para>Displays full help text for all dialogues.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-general</option></term>
	<listitem>
	  <para>Displays help text for general dialogue options.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-calendar</option></term>
	<listitem>
	  <para>Displays help text for calendar dialogue options.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-entry</option></term>
	<listitem>
	  <para>Displays help text for text entry dialogue options.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-error</option></term>
	<listitem>
	  <para>Displays help text for error dialogue options.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-info</option></term>
	<listitem>
	  <para>Displays help text for information dialogue options.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-file-selection</option></term>
	<listitem>
	  <para>Displays help text for file selection dialogue options.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-list</option></term>
	<listitem>
	  <para>Displays help text for list dialogue 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 dialogue options.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-question</option></term>
	<listitem>
	  <para>Displays help text for question dialogue options.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-warning</option></term>
	<listitem>
	  <para>Displays help text for warning dialogue options.</para>
	</listitem>
      </varlistentry>
 
      <varlistentry>
        <term><option>--help-text-info</option></term>
	<listitem>
	  <para>Displays help for text information dialogue 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>
 
    </variablelist>

  </sect2>

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

  <sect2 id="matedialog-miscellaneous-options">
    <title>Miscellaneous Options</title>

    <para><application>MateDialog</application> also provides the following miscellaneous options:</para>

    <variablelist>

      <varlistentry>
        <term><option>--about</option></term>
	<listitem>
	  <para>Displays the <guilabel>About MateDialog</guilabel> dialogue, which contains <application>MateDialog</application> version information, copyright information and developer information.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--version</option></term>
	<listitem>
	  <para>Displays the version number of <application>MateDialog</application>.</para>
	</listitem>
      </varlistentry>

    </variablelist>

  </sect2>

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

  <sect2 id="matedialog-gtk-options">
    <title>GTK+ Options</title>

    <para><application>MateDialog</application> supports the standard GTK+ options. For more information about the GTK+ options, execute the <command>matedialog -?</command> command.</para>

  </sect2>

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

  <sect2 id="matedialog-environment-variables">
    <title>Environment Variables</title>

    <para>
      Normally, <application>MateDialog</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="matedialog-calendar-options">
    <title>Calendar Dialogue</title>

    <para>
        Use the <option>--calendar</option> option to create a calendar dialog. <application>MateDialog</application> returns the selected date to standard output. If no date is specified on the command line, the dialog uses the current date.
    </para>
    <para>The calendar dialogue supports the following options:</para>

    <variablelist>

      <varlistentry>
        <term><option>--text</option>=<replaceable>text</replaceable></term>
	<listitem>
	  <para>Specifies the text that is displayed in the calendar dialogue.</para>
	</listitem>
      </varlistentry>
     	
      <varlistentry>
        <term><option>--day</option>=<replaceable>day</replaceable></term>
	<listitem>
	  <para>Specifies the day that is selected in the calendar dialogue. <replaceable>day</replaceable> must be a number between 1 and 31 inclusive.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--month</option>=<replaceable>month</replaceable></term>
	<listitem>
	  <para>Specifies the month that is selected in the calendar dialogue. <replaceable>month</replaceable> must be a number between 1 and 12 inclusive.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--year</option>=<replaceable>year</replaceable></term>
	<listitem>
	  <para>Specifies the year that is selected in the calendar dialogue.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--date-format</option>=<replaceable>format</replaceable></term>
	<listitem>
	  <para>Specifies the format that is returned from the calendar dialogue 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>The following example script shows how to create a calendar dialogue: <programlisting>
        #!/bin/sh


        if matedialog --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></para>

    <figure id="matedialog-calendar-screenshot">
      <title>Calendar Dialogue Example</title>
      <screenshot>
        <mediaobject>
          <imageobject>
              <imagedata fileref="figures/matedialog-calendar-screenshot.png" format="PNG"/>
          </imageobject>
          <textobject>
              <phrase><application>MateDialog</application> calendar dialogue example</phrase>
          </textobject>
        </mediaobject>
      </screenshot>
   </figure>
													  
  </sect1>


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

  <sect1 id="matedialog-file-selection-options">
    <title>File Selection Dialogue</title>

    <para>
	Use the <option>--file-selection</option> option to create a file selection dialog. <application>MateDialog</application> returns the selected files or directories to standard 
        output. The default mode of the file selection dialog is open.
    </para>
    <para>The file selection dialogue supports the following options:</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 dialogue when the dialogue is first shown.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--multiple</option></term>
	<listitem>
	  <para>Allows the selection of multiple filenames in the file selection dialogue.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--directory</option></term>
	<listitem>
	  <para>Allows only selection of directories in the file selection dialogue.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--save</option></term>
	<listitem>
	  <para>Set the file selection dialogue into save mode.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--separator</option>=<replaceable>separator</replaceable></term>
	<listitem>
	  <para>Specifies the string that is used to divide the returned list of filenames.</para>
	</listitem>
      </varlistentry>

    </variablelist>

    <para>The following example script shows how to create a file selection dialogue: <programlisting>
        #!/bin/sh

        FILE=`matedialog --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>

    <figure id="matedialog-fileselection-screenshot">
      <title>File Selection Dialogue Example</title>
      <screenshot>
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/matedialog-fileselection-screenshot.png" format="PNG"/>
	  </imageobject>
	  <textobject>
	    <phrase><application>MateDialog</application> file selection dialogue example</phrase>
	  </textobject>
        </mediaobject>
      </screenshot>
    </figure>

  </sect1>

<!-- ==== Notification Options ====== -->
  <sect1 id="matedialog-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

        matedialog --notification\
          --window-icon="info" \
          --text="There are system updates necessary!"
      </programlisting></para>

    <figure id="matedialog-notification-screenshot">
      <title>Notification Icon Example</title>
      <screenshot>
        <mediaobject>
          <imageobject>
              <imagedata fileref="figures/matedialog-notification-screenshot.png" format="PNG"/>
          </imageobject>
          <textobject>
              <phrase><application>MateDialog</application> notification icon example</phrase>
          </textobject>
        </mediaobject>
      </screenshot>
   </figure>
													  
  </sect1>

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

  <sect1 id="matedialog-list-options">
    <title>List Dialogue</title>

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

    <para>Data for the dialogue must specified column by column, row by row. Data can be provided to the dialogue 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 dialogue 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 dialogue. You must specify a <option>--column</option> option for each column that you want to display in the dialogue.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--checklist</option></term>
	<listitem>
	  <para>Specifies that the first column in the list dialogue contains check boxes.</para>
	</listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--radiolist</option></term>
	<listitem>
	  <para>Specifies that the first column in the list dialogue 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 dialogue returns the selected entries.</para>
	</listitem>
      </varlistentry>

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

    </variablelist>

    <para>The following example script shows how to create a list dialogue: <programlisting>
        #!/bin/sh

        matedialog --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 "MATE Dictionary does not handle proxy" \
            393823 Critical "Menu editing does not work in MATE 2.0"
      </programlisting></para>

    <figure id="matedialog-list-screenshot">
      <title>List Dialogue Example</title>
      <screenshot>
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/matedialog-list-screenshot.png" format="PNG"/>
	  </imageobject>
	  <textobject>
	    <phrase><application>MateDialog</application> list dialogue example</phrase>
	  </textobject>
        </mediaobject>
      </screenshot>
    </figure>

  </sect1>

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

  <sect1 id="matedialog-message-options">
    <title>Message Dialogues</title>

    <para><application>MateDialog</application> can create four types of message dialogue:</para>
    <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 dialogue.</para>

    <sect2 id="matedialog-error-dialog">
      <title>Error Dialogue</title>

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

      <para>The following example script shows how to create an error dialogue: <programlisting>
          #!/bin/bash

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

      <figure id="matedialog-error-screenshot">
        <title>Error Dialogue Example</title>
        <screenshot>
          <mediaobject>
            <imageobject>
              <imagedata fileref="figures/matedialog-error-screenshot.png" format="PNG"/>
	    </imageobject>
	    <textobject>
	      <phrase><application>MateDialog</application> error dialogue example</phrase>
	    </textobject>
          </mediaobject>
        </screenshot>
      </figure>
    </sect2>

    <sect2 id="matedialog-info-dialog">
      <title>Information Dialogue</title>

      <para>Use the <option>--info</option> option to create an information dialogue.</para>

      <para>The following example script shows how to create an information dialogue: <programlisting>
          #!/bin/bash

          matedialog --info \
          --text="Merge complete. Updated 3 of 10 files."
        </programlisting></para>

      <figure id="matedialog-information-screenshot">
        <title>Information Dialogue Example</title>
        <screenshot>
          <mediaobject>
            <imageobject>
              <imagedata fileref="figures/matedialog-information-screenshot.png" format="PNG"/>
	    </imageobject>
	    <textobject>
	      <phrase><application>MateDialog</application> information dialogue example</phrase>
	    </textobject>
          </mediaobject>
        </screenshot>
      </figure>
    </sect2>

    <sect2 id="matedialog-question-dialog">
      <title>Question Dialogue</title>

      <para>Use the <option>--question</option> option to create a question dialogue.</para>

      <para>The following example script shows how to create a question dialogue: <programlisting>
          #!/bin/bash

          matedialog --question \
          --text="Are you sure you wish to proceed?"
        </programlisting></para>

      <figure id="matedialog-question-screenshot">
        <title>Question Dialogue Example</title>
        <screenshot>
          <mediaobject>
            <imageobject>
              <imagedata fileref="figures/matedialog-question-screenshot.png" format="PNG"/>
	    </imageobject>
	    <textobject>
	      <phrase><application>MateDialog</application> question dialogue example</phrase>
	    </textobject>
          </mediaobject>
        </screenshot>
      </figure>
    </sect2>

    <sect2 id="matedialog-warning-dialog">
      <title>Warning Dialogue</title>

      <para>Use the <option>--warning</option> option to create a warning dialogue.</para>

      <para>The following example script shows how to create a warning dialogue: <programlisting>
          #!/bin/bash
        
          matedialog --warning \
          --text="Disconnect the power cable to avoid electrical shock."
        </programlisting></para>

      <figure id="matedialog-warning-screenshot">
        <title>Warning Dialogue Example</title>
        <screenshot>
          <mediaobject>
            <imageobject>
              <imagedata fileref="figures/matedialog-warning-screenshot.png" format="PNG"/>
	    </imageobject>
	    <textobject>
	      <phrase><application>MateDialog</application> warning dialogue example</phrase>
	    </textobject>
          </mediaobject>
        </screenshot>
      </figure>
    </sect2>

  </sect1>

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

  <sect1 id="matedialog-progress-options">
    <title>Progress Dialogue</title>

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

    <para><application>MateDialog</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 dialogue supports the following options:</para>

    <variablelist>

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

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

      <varlistentry>
	<term><option>--auto-close</option></term>
	<listitem>
	  <para>Closes the progress dialogue 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 dialogue: <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
        ) |
        matedialog --progress \
          --title="Update System Logs" \
          --text="Scanning mail logs..." \
          --percentage=0

        if [ "$?" = -1 ] ; then
                matedialog --error \
                  --text="Update cancelled."
        fi

      </programlisting></para>

    <figure id="matedialog-progress-screenshot">
      <title>Progress Dialogue Example</title>
      <screenshot>
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/matedialog-progress-screenshot.png" format="PNG"/>
	  </imageobject>
	  <textobject>
	    <phrase><application>MateDialog</application> progress dialogue example</phrase>
	  </textobject>
        </mediaobject>
      </screenshot>
    </figure>

  </sect1>

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

  <sect1 id="matedialog-text-entry-options">
    <title>Text Entry Dialogue</title>

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

    <variablelist>

      <varlistentry>
        <term><option>--text</option>=<replaceable>text</replaceable></term>
	<listitem>
	  <para>Specifies the text that is displayed in the text entry dialogue.</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 dialogue.</para>
	</listitem>
      </varlistentry>

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

    </variablelist>

    <para>The following example script shows how to create a text entry dialogue: <programlisting>
        #!/bin/sh

        if matedialog --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="matedialog-entry-screenshot">
      <title>Text Entry Dialogue Example</title>
      <screenshot>
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/matedialog-entry-screenshot.png" format="PNG"/>
	  </imageobject>
	  <textobject>
	    <phrase><application>MateDialog</application> text entry dialogue example</phrase>
	  </textobject>
        </mediaobject>
      </screenshot>
    </figure>
  </sect1>

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

  <sect1 id="matedialog-text-options">
    <title>Text Information Dialogue</title>

    <para>Use the <option>--text-info</option> option to create a text information dialogue.</para>
	
    <para>The text information dialogue 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 dialogue.</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 dialogue: <programlisting>
        #!/bin/sh

        FILE=`matedialog --file-selection \
          --title="Select a File"`

        case $? in
                 0)
                        matedialog --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="matedialog-text-screenshot">
      <title>Text Information Dialogue Example</title>
      <screenshot>
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/matedialog-text-screenshot.png" format="PNG"/>
	  </imageobject>
	  <textobject>
	    <phrase><application>MateDialog</application> text information dialogue example</phrase>
	  </textobject>
        </mediaobject>
      </screenshot>
    </figure>

  </sect1>

</article>
