I want to report a bug about zenity 3.42.1 on ubuntu 22.04.

Asked by Thomas Sauve

'--question' attribute in zenity is not returning a value after the user interacts with the message box. It should be returning a 0, 1, or 5 depending on what the user selects. Other forms that zenity produces do return the appropriate values.
tom@BossUbuntui9:~$ zenity --version
3.42.1
tom@BossUbuntui9:~$ zenity --calendar
09/12/2024
tom@BossUbuntui9:~$ zenity --question --title="Answer the question." --text="Yes or No?"
tom@BossUbuntui9:~$
This is a paste from my terminal. As you can see the --version and --calendar arguments return the appropriate values. When I use the --question argument, it does not matter whether I press yes or no, I get nothing.

Revision history for this message
Manfred Hampl (m-hampl) said :
#1

See the man pages:
"... and return (either in the return code, or on standard output) the users input."

The answer to "--question" is returned in the return code, not in standard output.

user@ubuntu:~$ zenity --question --title="Answer the question." --text="Yes or No?" # answering yes
user@ubuntu:~$ echo $?
0
user@ubuntu:~$ zenity --question --title="Answer the question." --text="Yes or No?" # answering no
user@ubuntu:~$ echo $?
1

Can you help with this problem?

Provide an answer of your own, or ask Thomas Sauve for more information if necessary.

To post a message you must log in.