Xdialog(dialog)

王朝厨房·作者佚名  2007-01-05
宽屏版  字体: |||超大  

摘要:Xdialog(dialog)

If you don't know what's the Xdialog(dialog), you can just copy the following lines to your terminal: what you can see??

bash

Xdialog --yesno "Do you want to learn more about Xdialog?" 0 0;case $? in

0)

echo "Result: Yes chosen.";;

1)

echo "Result: No chosen.";;

255)

echo "ESC pressed.";;

esac

Xdialog and dialog are very easy to use but of course not as powerful as a real graphical application. They fill the gap between a pure ASCII shell script and a full graphical application.

Xdialog and dialog come with a directoy called "samples" where you can find more examples (Redhat 7.3 stores them under /usr/share/doc/Xdialog-2.0.5/samples). Be careful however as some of them really do something and are not pure demo applications.

Xdialog and dialog offer a number of different dialog boxes. Not all of them are always appropriate for all types of shell scripts

The above was a pretty useless example of dialog/Xdialog but it shows how easy it is to program a simple graphical dialog. There are more interesting dialog boxes. Boxes like calendar, menus, filemanager, progess bar, text input, message box, password dialog, ... You can run

dialog --help

or

Xdialog --help

to get a list of the available dialog boxes. Xdialog has a few more boxes than dialog.

References:

http://www.chez.com/godefroy/

http://fr.linuxfocus.org/English/November2002/article267.shtml

small examples: GUI tar

http://fr.linuxfocus.org/common/src/article267/mktgz.txt

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有