Use a opción --list.

This work is licensed under a GNU Free Documentation License Version 1.1 or any later version.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License (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 link.

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.

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.

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

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

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.

Fran Dieguez
frandieguez@gnome.org 2011-2012.

# Diálogo de lista

Use a opción --list para crear un diálogo de lista. Zenity devolve as entradas na primeira columna de texto das filas seleccionadas á saída estándar.

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.

If you use the --checklist or --radiolist options, each row must start with either 'TRUE' or 'FALSE'.

O diálogo de lista admite as seguintes opcións:

# --column=column

Specifies the column headers that are displayed in the list dialog. You must specify a --column option for each column that you want to display in the dialog.

# --checklist

Especifica que a primeira columna no diálogo de lista contén caixas de verificación.

# --radiolist

Especifica que a primeira columna no diálogo de lista contén caixas de opción.

# --editable

permite editar os elementos mostrados.

# --separator=separador

Especifica que cadea se usa cando o diálogo de lista devolve as entradas seleccionadas.

# --print-column=columna

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.

O seguinte script de exemplo mostra como se crea un diálogo de lista:

#!/bin/sh

zenity --list \ --title="Choose the Bugs You Wish to View" \ --column="Número de erro" --column="Importancia" --column="Descrición" \ 992383 Normal "GtkTreeView ten erros cando hai múltiples seleccións" \ 293823 High "GNOME Dictionary non xestiona o proxy" \ 393823 Critical "A edición de menú non funciona en GNOME 2.0"

# Exemplo de diálogo de lista

Exemplo de diálogo de lista de Zenity