2009-10-25 34 views
1

如何同時顯示輸入框和menubox?inputbox和menubox同時

dialog --title "Title" \ 
--backtitle "Terms" \ 
--menu "Foo" 15 50 4 \ 
Date/time "Displays date and time" \ 
Calendar "Displays a calendar" \ 
Editor "Start a text editor" \ 
Exit "Exit to the shell" \ 
--inputbox "Your name!" 8 60 

retval=$? 
case $retval in 
0) 
echo 'The name is '$input';; 
1) 
echo "Cancel pressed.";; 
esac 

回答

1

恐怕這可能是接近你可以得到:

dialog --title "Title" \ 
--backtitle "Terms" \ 
--keep-window --begin 3 12 \ 
--menu "Foo" 11 50 4 \ 
Date/time "Displays date and time" \ 
Calendar "Displays a calendar" \ 
Editor "Start a text editor" \ 
Exit "Exit to the shell" \ 
--and-widget --keep-window --begin 16 8 \ 
--inputbox "Your name!" 8 60 

這顯示菜單和離開它做出選擇後屏幕上(或取消結束它,並跳過輸入框)。然後它顯示輸入框,並在輸入內容或選擇取消後在屏幕上同時顯示。

我調整了一些數字,以適應25行屏幕。

如果您正在尋找用戶可以同時與兩者互動的內容,那麼dialog可能無法使用。