📄 00000001.htm
字号:
<HTML><HEAD> <TITLE>BBS水木清华站∶精华区</TITLE></HEAD><BODY><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER>发信人: reden (Offer 快快来啊 ~!), 信区: Linux <BR>标 题: Linux程式设计入门 - Dialog <BR>发信站: BBS 水木清华站 (Thu Apr 1 12:51:42 1999) <BR> <BR>Linux程式设计入门 - Dialog <BR> <BR> <BR> <BR> dialog是个shell scripts用的,事实上当您下载Linux Kernel时,里面有个 <BR> <BR> scripts/lxdialog目录,其实那就是dialog原始码,只是Linux kernel为了避 <BR> <BR> 免与原有dialog相冲突,将名字修改为lxdialog。当您使用"make menuconfig" <BR> <BR> 时,便是在用dialog这套工具。另外,Slackware的安装程式,事实上也是用 <BR> <BR> dialog这套工具来做界面的。 <BR> <BR> <BR> 您可以利用shell script来呼叫dialog,也可以利用perl来呼叫它,用以提供 <BR> <BR> 较友善的使用者界面。 <BR> <BR> <BR> 利用dialog这个工具,您可以在不需要写"艰深"的ncurses的程式的状况下,使 <BR> <BR> 用Shell Script,完成很复杂的操作界面,大大减少产品开发时间。 <BR> <BR> <BR> <BR> 您可以用"man dialog"来查它的使用方法。这里做一些dialog的使用及示范。 <BR> <BR> <BR> dialog --clear <BR> <BR> <BR> 整个萤幕会清除後离开 <BR> <BR> <BR> dialog --create-rc file <BR> <BR> <BR> dialog支援动态规划,这个功能会产生一个样本。 <BR> <BR> <BR> dialog [ --title title ] [ --backtitle backtitle ] <BR> <BR> [--clear ] [ --separate-output ] box-options <BR> <BR> <BR> --title title <BR> <BR> <BR> 对话盒上的标题文字 <BR> <BR> <BR> --backtitle backtitle <BR> <BR> <BR> 桌面背景的标题 <BR> <BR> <BR> box-options <BR> <BR> <BR> dialog目前提供了yes/no box, menu box, input box, message box, text <BR> <BR> box, info box, checklist box, radiolist box, 及gauge box共九种widget. <BR> <BR> <BR> Exit Status <BR> <BR> <BR> 如果按下Yes或OK按键,则会返回0。No或Cancel会返回1。如果按下ESC或发生 <BR> <BR> 错误,则会返回-1。 <BR> <BR> <BR> --yesno text height width <BR> <BR> <BR> [foxman@foxman /]# dialog --title "hello" --backtitle "Dialog" <BR> <BR> --yesno "Is everything okay" 20 60 <BR> <BR> <BR> <BR> --msgbox text height width <BR> <BR> <BR> [foxman@foxman /]# dialog --title "hello" --backtitle "Dialog" <BR> <BR> --msgbox "Is everything okay" 20 60 <BR> <BR> <BR> <BR> --infobox text height width <BR> <BR> <BR> [foxman@foxman dialog]# dialog --title "hey" --backtitle "Dialog" <BR> <BR> --infobox "Is everything okay?" 10 60 <BR> <BR> <BR> Infobox会在显示讯息後立即离开,在console的状况下,讯息会留下,但在X <BR> <BR> Terminal下,由於X Terminal会立即将讯息清除,Screen Shot抓不到,因此这 <BR> <BR> 里没有ScreenShot。您可以在console下测试。 <BR> <BR> <BR> --inputbox text height width [init] <BR> <BR> <BR> [foxman@foxman dialog]# dialog --title "hey" --backtitle "Dialog" <BR> <BR> --inputbox "Is everything okay?" 10 60 "yes" <BR> <BR> <BR> <BR> <BR> <BR> <BR> --textbox file height width <BR> <BR> <BR> [foxman@foxman copyright]# dialog --title "Array 30" --backtitle "All <BR> <BR> For Chinese" --textbox array30 20 75 <BR> <BR> <BR> <BR> textbox很像是个简单的text viewer,它会显示档案中的文字。 <BR> <BR> <BR> --menu text height width menu-height [ tag item ] ... <BR> <BR> <BR> [foxman@foxman dialog]# dialog --title "Menu Example" --menu "MENU" <BR> <BR> 20 60 4 tag1 " item1" tag2 "item2" tag3 "item3" tag4 "item4" <BR> <BR> <BR> <BR> <BR> <BR> <BR> --checklist text height width list-height [ tag item status ] <BR> <BR> ... <BR> <BR> <BR> [foxman@foxman dialog]# dialog --title "CheckList Example" <BR> <BR> --checklist "Check List" 20 60 4 tag1 "item1" on tag2 "item2" off <BR> <BR> tag3 "item3" on tag4 "item4" off <BR> <BR> <BR> <BR> --radiolist text height width list-height [ tag item status <BR> <BR> ] ... <BR> <BR> <BR> [foxman@foxman dialog]# dialog --title "RadioList Example" <BR> <BR> --radiolist "Radio List" 20 60 4 tag1 "item1" on tag2 "item2" off <BR> <BR> tag3 "item3" on tag4 "item4" off <BR> <BR> <BR> <BR> --gauge text height width percent <BR> <BR> <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -