error message when running zenity under 16.04: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged

Solution 1:

Ignore it.

It's a warning, not an error. The application works, it's just not coded with best practices in mind, as it seems. You would have to modify zenity's source code to implement the fix described in your linked question and then compile it yourself, but... it works anyway, so why should you bother?

If you just want to get rid of the output in your terminal, you could simply redirect STDERR (standard error stream, that's where the warning gets printed to) to /dev/null (virtual character device that swallows data) by appending 2> /dev/null to the end of the command, like this:

zenity --text-info --filename=<filename> 2> /dev/null

Solution 2:

It seems that the Gtk devs decided to add this warning which affects a number of packages. We just have to wait for the Zenity dev to catch up and fix Zenity.

With the bash shell (this is not Posix-compliant) it's relatively simple to suppress specific error messages while allowing other messages through to stderr:

zenity --info --text "hello" 2> >(grep -v 'GtkDialog' >&2)

This does not interfere with stdout, so that may be piped or used in command substitution as normal:

echo message: $(zenity --entry  2> >(grep -v 'GtkDialog' >&2) )