shell - How can I generate an OKCancel box with the dialog command? - Stack Overflow

I want to generate the graphic below, from the (Linux) command-line.I can get pretty close to that by

I want to generate the graphic below, from the (Linux) command-line.

I can get pretty close to that by invoking:

dialog --title "fsfe" --msgbox  "This computer\nis not old,\nit is sustainable" 10 22

But that only gives me an OK button; I need OK/Cancel. Can I do that with the dialog program?

I want to generate the graphic below, from the (Linux) command-line.

I can get pretty close to that by invoking:

dialog --title "fsfe." --msgbox  "This computer\nis not old,\nit is sustainable" 10 22

But that only gives me an OK button; I need OK/Cancel. Can I do that with the dialog program?

Share Improve this question asked Mar 22 at 16:48 einpoklumeinpoklum 133k80 gold badges420 silver badges864 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

You can do it also in dialog:

You need to add an extra button to the box.

$ dialog \
        --ok-label 'OK' \
        --extra-button --extra-label 'Cancel' \
        --title 'fsfe.' \
        --msgbox 'This computer\nis not old,\nit is sustainable' \
        8 30

Try:

whiptail \
    --title "fsfe." \
    --yesno "This computer\nis not old,\nit is sustainable." \
    --yes-button "OK" --no-button "Cancel" \
    10 26

this will not give you exactly what you want - There will be no separation between the main text area and the two buttons - but it's very close. Exact colors may depend on your specific distribution and various settings.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744307812a4567803.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信