<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="usage" xml:lang="sv">
<info>
  <link type="guide" xref="index"/>
  <desc>You can use <app>Zenity</app> to create simple dialogs that interact graphically with the user.</desc>
</info>
<title>Användning</title>
    <p>
	When you write scripts, you can use <app>Zenity</app> to create simple dialogs that interact graphically with the user, as follows:
    </p>
    <list>
      <item>
        <p>Du kan skapa en dialogruta för att hämta in information från användaren. Till exempel kan du fråga användaren om att välja ett datum från en kalenderdialog, eller att välja en fil från en filväljardialog.</p>
      </item>
      <item>
        <p>Du kan skapa en dialogruta för att tillhandahålla information till användaren. Till exempel kan du använda en förloppsdialog för att indikera aktuell status för en åtgärd, eller använda en varningsdialog för att larma användaren.</p>
      </item>
    </list>
    <p>
	When the user closes the dialog, <app>Zenity</app> prints the text produced by the dialog to standard output.
    </p>

    <note>
      <p>
        When you write <app>Zenity</app> commands, ensure that you place quotation marks around each argument. 
      </p>
      <p>For example, use:</p>
      <screen>zenity --calendar --title="Holiday Planner"</screen>
      <p>Do not use:</p>
      <screen>zenity --calendar --title=Holiday Planner</screen>
      <p>Om du inte använder citationstecken kan du få oväntade resultat.</p>
    </note>

    <section id="zenity-usage-mnemonics">
      <title>Snabbtangenter</title>
	<p>En snabbtangent är en tangent som låter dig genomföra en åtgärd från tangentbordet istället för att använda musen för att välja ett kommando från en meny eller dialog. Varje snabbtangent identifieras av en understruken bokstav i en meny eller dialogflagga.</p>
	<p>
          Some <app>Zenity</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:
	</p>
	<screen><input>"_Välj ett namn".</input></screen>
    </section>

    <section id="zenity-usage-exitcodes">
      <title>Avslutningskoder</title>
    <p>
        Zenity returns the following exit codes:
    </p>

    <table frame="all" rules="all">
        <thead>
          <tr valign="top">
            <td colname="COLSPEC0">
              <p>Avslutningskod</p></td>
            <td colname="COLSPEC1">
              <p>Beskrivning</p></td>
          </tr>
        </thead>
        <tbody>
          <tr valign="top">
            <td>
              <p><var>0</var></p>
            </td>
            <td>
              <p>The user has pressed either <gui style="button">OK</gui> or <gui style="button">Close</gui>.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p><var>1</var></p>
            </td>
            <td>
              <p>The user has either pressed <gui style="button">Cancel</gui>, or used the window functions to close the dialog.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p><var>-1</var></p>
            </td>
            <td>
              <p>Ett oväntat fel har inträffat.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p><var>5</var></p>
            </td>
            <td>
              <p>Dialogrutan har stängts därför att tidsgränsen har nåtts.</p>
            </td>
          </tr>
        </tbody>
    </table>

    </section>


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

  <section id="zenity-usage-general-options">
    <title>Allmänna alternativ</title>

    <p>
	All Zenity dialogs support the following general options:
    </p>

    <terms>

      <item>
        <title><cmd>--title</cmd>=<var>title</var></title>
	<p>Anger titeln på en dialogruta.</p>
      </item>

      <item>
        <title><cmd>--window-icon</cmd>=<var>icon_path</var></title>
	<p>Anger ikonen som visas i fönsterramen för dialogen. Det finns 4 standardikoner som finns tillgängliga genom att ange något av följande nyckelord - "info", "warning", "question" och "error".</p>
      </item>

      <item>
        <title><cmd>--width</cmd>=<var>width</var></title>
	<p>Anger bredden på dialogrutan.</p>
      </item>

      <item>
        <title><cmd>--height</cmd>=<var>height</var></title>
	<p>Anger höjden på dialogrutan.</p>
      </item>

      <item>
        <title><cmd>--timeout</cmd>=<var>timeout</var></title>
	<p>Anger tidsgränsen i sekunder efter vilken dialogrutan stängs.</p>
      </item>

    </terms>

  </section>

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

  <section id="zenity-help-options">
    <title>Hjälpflaggor</title>

    <p>
	Zenity provides the following help options:
    </p>

    <terms>

      <item>
        <title><cmd>--help</cmd></title>
	<p>Visar förkortad hjälptext.</p>
      </item>

      <item>
        <title><cmd>--help-all</cmd></title>
	<p>Visar fullständig hjälptext för alla dialoger.</p>
      </item>
 
      <item>
        <title><cmd>--help-general</cmd></title>
	<p>Visar hjälptext för allmänna dialogflaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-calendar</cmd></title>
	<p>Visar hjälptext för kalenderdialogflaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-entry</cmd></title>
	<p>Visar hjälptext för textinmatningsdialogflaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-error</cmd></title>
	<p>Visar hjälptext för feldialogflaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-info</cmd></title>
	<p>Visar hjälptext för informationsdialogflaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-file-selection</cmd></title>
	<p>Visar hjälptext för filväljardialogflaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-list</cmd></title>
	<p>Visar hjälptext för listdialogflaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-notification</cmd></title>
	<p>Visar hjälptext för notifieringsikonflaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-progress</cmd></title>
	<p>Visar hjälptext för förloppsdialogflaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-question</cmd></title>
	<p>Visar hjälptext för frågedialogflaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-warning</cmd></title>
	<p>Visar hjälptext för varningsdialogflaggor.</p>
      </item>
 
      <item>
	<title><cmd>--help-text-info</cmd></title>
	<p>Visar hjälp för textinformationsdialogflaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-misc</cmd></title>
	<p>Visar hjälp för diverse flaggor.</p>
      </item>
 
      <item>
        <title><cmd>--help-gtk</cmd></title>
	<p>Visar hjälp för GTK+-flaggor.</p>
      </item>
 
    </terms>

  </section>

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

  <section id="zenity-miscellaneous-options">
    <title>Diverse flaggor</title>

    <p>
	Zenity also provides the following miscellaneous options:
    </p>

    <terms>

      <item>
        <title><cmd>--about</cmd></title>
	<p>Displays the <gui>About Zenity</gui> dialog, which contains Zenity version information, copyright information, and developer information.</p>
      </item>

      <item>
        <title><cmd>--version</cmd></title>
	<p>Displays the version number of Zenity.</p>
      </item>

    </terms>

  </section>

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

  <section id="zenity-gtk-options">
    <title>GTK+-flaggor</title>

    <p>
	Zenity supports the standard GTK+ options. For more information about the GTK+ options, execute the <cmd>zenity --help-gtk</cmd> command.
    </p>

  </section>

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

  <section id="zenity-environment-variables">
    <title>Environment Variables</title>

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

  </section>
</page>
