tags:

views:

38

answers:

1

Hi. How to display simultaneously an inputbox and a 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  A: 

I'm afraid this may be as close as you can get:

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

This displays the menu and leaves it on the screen after a selection is made (or cancel ends it and skips the input box). Then it displays the input box and leaves both on the screen after something is entered or cancel is selected.

I adjusted some of the numbers so it would fit on a 25-line screen.

If you're looking for something where the user can interact with both at the same time, then dialog may not be capable.

Dennis Williamson