Without seeing your code I can only suggest some guidelines. I apologize for using ALL CAPS below, I'm being lazy to avoid having to tediously enter bbcodes. I'm not shouting.
1) Yad outputs to stdout - not stderr, unless you redirect it to do so.
2) Yad's MAIN widget outputs when the dialog EXITS - no way around this. By MAIN widget I mean one of --form, --list, --text-info (when it does), --color, --file, etc., that is, the main purpose of the dialog.
3) Yad will NOT output if the dialog exits with NON-ZERO status.
4) There is a method for some MAIN widgets (FORM and LIST, YYRC) to output also before yad exits. The method consists in setting the value of a FORM button or LIST ACTION to a (shell) command that STARTS WITH @
. Then when the button or list item is actioned, command's stdout is CAPTURED and any lines that START WITH N:
are subtracted from stdout and redirected back to the MAIN widget, precisely to the N
th item thereof. Note: the current design has some issues that are being looked at on GitHub, where the development of yad takes place (#214, #219).
5) There is another method for the SCALE main widget to output to stdout as it's being affected: combine options --scale --print-partial.
Worth mentioning that aside from the points above, REGULAR yad buttons can output to stdout at any time. By REGULAR I mean buttons that don't belong to the MAIN widget, in other words, --button buttons.