Quantcast
Channel: User ozzy - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 31

Answer by ozzy for About ||||| (pipe or vertical bars) In yad --form --button

$
0
0

I cannot reproduce the situation you describe entirely, but I think you need to ask yourself what you want yad to do when a button is pressed, or, more specifically, how yad should communicate any user choice back to you, i.e. via an exit code or via information on standard output.

The option --button="gtk-ok" creates a button that is not tied to an exit code with which yad can exit and silently let you know that this particular button was pressed. Consequently, it seems, it will try to inform you via output on stdout (printing two default output separator characters). To prevent this, you could rephrase the option, e.g. like so:

--button="gtk-ok":1

which ties an exit code of 1 to pressing the OK button, and prevents further output. At the command prompt (or in a script), you can test this exit code, which is available as $?.

Importantly: note that the yad manpage indicates that the proper syntax for the `--button'-option is:

--button=BUTTON:ID
Add the dialog button. May be used multiply times. ID is an exit code or a command. (...)

So the option `--button="gtk-ok" seems to be syntactically incorrect.


To get the behaviour your describe, I had to change --field="Click Down":LBL "echo Clicked" into --field="Click Down":BTN "echo Clicked".


All in all, the following command works as expected on my system:

yad --width=400 --height=200 --button="gtk-ok":1 --form --field="Click Down":BTN "echo Clicked" --field="Click HERE":BTN

Viewing all articles
Browse latest Browse all 31

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>