文本信息框

使用 --text-info 选项来创建一个文本信息框。

文本信息框支持以下选项:

--filename=文件名

指定一个加载到文本信息框里的文件。

--editable

显示的文本允许编辑,当对话框关闭后,编辑后的文本显示到显示器上。

--font=字体

指定文本字体。

--checkbox=文本

启用复选框,如“我已阅读并接受该条款。”

--html

启用 html 支持。

--url=网址

设置一个网址,而不是文件。只有当您使用 --html 选项时才有效。

下面的脚本示范了如何创建一个文本信息对话框:

#!/bin/sh

# You must place file "COPYING" in same folder of this script.
FILE=`dirname $0`/COPYING

zenity --text-info \
       --title="License" \
       --filename=$FILE \
       --checkbox="I read and accept the terms."

case $? in
    0)
        echo "Start installation!"
	# next step
	;;
    1)
        echo "Stop installation!"
	;;
    -1)
        echo "An unexpected error has occurred."
	;;
esac

文本信息框范例

Zenity 文本信息对话框范例