Message Dialogs

Zenity can create four types of message dialog:

  • Erro
  • Información
  • Pregunta
  • Advertencia

For each type, use the --text option to specify the text that is displayed in the dialog.

7.1. Error Dialog

Use the --error option to create an error dialog.

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

          #!/bin/bash

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

Figura 5Error Dialog Example

7.2. Information Dialog

Use the --info option to create an information dialog.

The following example script shows how to create an information dialog:

          #!/bin/bash

          zenity --info \
          --text="Merge complete. Updated 3 of 10 files."
        

Figura 6Information Dialog Example

7.3. Question Dialog

Use the --question option to create a question dialog.

The following example script shows how to create a question dialog:

          #!/bin/bash

          zenity --question \
          --text="Are you sure you wish to proceed?"
        

Figura 7Exemplo do diálogo de pregunta

7.4. Diálogo de advertencia

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

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

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

Figura 8Warning Dialog Example