summaryrefslogtreecommitdiff
path: root/help/zh_CN/usage.page
blob: ea818c0a889b88ab57f47b50fd8036856183f724 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="usage" xml:lang="zh-CN">
<info>
  <link type="guide" xref="index"/>
  <desc>您可以使用 <app>Zenity</app> 创建简单的交互式对话框。</desc>

    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>TeliuTe</mal:name>
      <mal:email>teliute@163.com</mal:email>
      <mal:years>2010</mal:years>
    </mal:credit>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>tuhaihe</mal:name>
      <mal:email>1132321739qq@gmail.com</mal:email>
      <mal:years>2012</mal:years>
    </mal:credit>
  </info>
<title>用法</title>
    <p>在您写脚本时,可以使用 <app>Zenity</app> 创建简单的交互式对话框,方法如下:</p>
    <list>
      <item>
        <p>您可以创建对话框以从用户获得信息。例如,您可以提示用户从日历对话框中选择日期,或者从文件选择框里选择一个文件。</p>
      </item>
      <item>
        <p>您可以创建向用户提供信息的对话框。例如,您可以用进度条来显示一个操作的当前运行状态,或者用一个警告框提醒用户。</p>
      </item>
    </list>
    <p>当用户关闭了对话框,<app>Zenity</app> 将在标准输出中打印对话框操作的文本。</p>

    <note>
      <p>当您写了 <app>Zenity</app> 命令,确保每个参数用引号括起来。</p>
      <p>例如,使用:</p>
      <screen>zenity --calendar --title="假日计划"</screen>
      <p>不要使用:</p>
      <screen>zenity --calendar --title=假日计划</screen>
      <p>如果您没有使用引号,可能会产生不可预料的结果。</p>
    </note>

    <section id="zenity-usage-mnemonics">
      <title>访问键</title>
	<p>访问键允许您用键盘来执行一个操作,而不是用鼠标点击菜单命令或对话框按钮。每个访问键有一个标识符,是一个在菜单或对话框选项上的带下划线的字母。</p>
	<p>一些 <app>Zenity</app> 对话框支持使用访问键。要指定一个字符用于访问键,在对话框的文本字符前面加一个下划线。下面的例子是如何让字母“C”作为访问键:</p>
	<screen><input>“选择一个名字(_C)”。</input></screen>
    </section>

    <section id="zenity-usage-exitcodes">
      <title>退出代码</title>
    <p>Zenity 返回以下退出代码:</p>

    <table frame="all" rules="all">
        <thead>
          <tr>
            <td>
              <p>退出代码</p></td>
            <td>
              <p>描述</p></td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>
              <p><var>0</var></p>
            </td>
            <td>
              <p>用户已经按下 <gui style="button">确定</gui> 或 <gui style="button">关闭</gui>。</p>
            </td>
          </tr>
          <tr>
            <td>
              <p><var>1</var></p>
            </td>
            <td>
              <p>用户按了 <gui style="button">取消</gui>,或者点了窗口关闭按钮关闭对话框。</p>
            </td>
          </tr>
          <tr>
            <td>
              <p><var>-1</var></p>
            </td>
            <td>
              <p>发生了意外错误。</p>
            </td>
          </tr>
          <tr>
            <td>
              <p><var>5</var></p>
            </td>
            <td>
              <p>对话框因超时而关闭。</p>
            </td>
          </tr>
        </tbody>
    </table>

    </section>


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

  <section id="zenity-usage-general-options">
    <title>常规选项</title>

    <p>所有的 Zenity 对话框支持以下常规选项:</p>

    <terms>

      <item>
        <title><cmd>--title</cmd>=<var>标题</var></title>
	<p>指定对话框的标题。</p>
      </item>

      <item>
        <title><cmd>--window-icon</cmd>=<var>图标路径</var></title>
	<p>指定显示在对话窗口框上的图标。有四个图标也可以用下列关键字 - 'info', 'warning', 'question' 和 'error'。</p>
      </item>

      <item>
        <title><cmd>--width</cmd>=<var>宽度</var></title>
	<p>指定对话框的宽度。</p>
      </item>

      <item>
        <title><cmd>--height</cmd>=<var>高度</var></title>
	<p>指定对话框的高度。</p>
      </item>

      <item>
        <title><cmd>--timeout</cmd>=<var>超时</var></title>
	<p>指定超出时间(秒)后对话框自动关闭。</p>
      </item>

    </terms>

  </section>

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

  <section id="zenity-help-options">
    <title>帮助选项</title>

    <p>Zenity 提供以下帮助选项:</p>

    <terms>

      <item>
        <title><cmd>--help</cmd></title>
	<p>显示简短的帮助文本。</p>
      </item>

      <item>
        <title><cmd>--help-all</cmd></title>
	<p>显示所有对话框的完整帮助。</p>
      </item>
 
      <item>
        <title><cmd>--help-general</cmd></title>
	<p>显示常规对话框选项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-calendar</cmd></title>
	<p>显示日历对话框选项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-entry</cmd></title>
	<p>显示文本输入框选项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-error</cmd></title>
	<p>显示错误框选项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-info</cmd></title>
	<p>显示信息框选项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-file-selection</cmd></title>
	<p>显示文件打开框选项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-list</cmd></title>
	<p>显示列表框选项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-notification</cmd></title>
	<p>显示提示框选项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-progress</cmd></title>
	<p>显示进度框选项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-question</cmd></title>
	<p>显示询问框选项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-warning</cmd></title>
	<p>显示警告框选项的帮助文本。</p>
      </item>
 
      <item>
	<title><cmd>--help-text-info</cmd></title>
	<p>显示信息框选项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-misc</cmd></title>
	<p>显示其他杂项的帮助文本。</p>
      </item>
 
      <item>
        <title><cmd>--help-gtk</cmd></title>
	<p>显示 GTK+ 选项的帮助文本。</p>
      </item>
 
    </terms>

  </section>

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

  <section id="zenity-miscellaneous-options">
    <title>杂项</title>

    <p>Zenity 也提供了如下杂项:</p>

    <terms>

      <item>
        <title><cmd>--about</cmd></title>
	<p>显示 <gui>关于 Zenity</gui> 对话框,包含 Zenity 版本信息、版权信息和开发者信息。</p>
      </item>

      <item>
        <title><cmd>--version</cmd></title>
	<p>显示 Zenity 的版本号。</p>
      </item>

    </terms>

  </section>

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

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

    <p>Zenity 支持标准的 GTK+ 选项。更多 GTK+ 选项的相关信息,请执行 <cmd>zenity --help-gtk</cmd> 命令。</p>

  </section>

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

  <section id="zenity-environment-variables">
    <title>环境变量</title>

    <p>通常,Zenity 会检测启动它的终端窗口,并保持在它之上。这个行为也可以通过不设置 <var>WINDOWID</var> 环境变量来禁用。</p>

  </section>
</page>
bgstack15