bashuser-interfacezenity

Multiple choice window in zenity


How to add buttons in zenity in order to make a multiple choice question? Something like:

zenity --info \
--title="Super Quizz" \
--text="Who is Mark Zuckerberg?" \
--add-button="A soccer player" \
--add-button="An astronaut" \
--add-button="An internet entrepreneur" \
--add-button="I don't know"

Solution

  • I think your best option is to use a radio list instead:

    zenity --list \
    --title="Super Quizz" \
    --text "Who is Mark Zuckerberg?" \
    --radiolist \
    --column "Pick" \
    --column "Answer" \
    FALSE "A soccer player" \
    FALSE "An astronaut" \
    FALSE "An internet entrepreneur" \
    FALSE "I don't know"