Silence GTK warnings
https://stackoverflow.com/questions/73497302/gtk-suppress-all-messages
:-|
wow, now the SO question got deleted for no apparent reason, other than that it had a score of -1. I guess 9k reputation isn't enough... I still think it's a valid question or at least I don't know how to proceed, so I will repost it here.
Is it possible to make GTK shut up altogether in C? I'm using Crystal bindings (based on C) and
Gtk-Message: 02:37:47.100: (for origin information, set GTK_DEBUG): failed to retrieve property blablamessages are everywhere and mess up the CLI :-/I already asked this on the Gtk Matrix channel, and the suggested fix I got was (verbatim)
Fix your code and/or bindings
Which is not a solution to this problem I think. Try for example to put a nonsense config key into ~/.config/gtk-3.0/settings.ini and now most Gtk applications will show a warning when you start them. I know that I can fix my ini file, but my users may not. Besides, I can't just "fix my bindings" I'm afraid, because that is a massive undertaking way out of scope for developing a small depending application. It would not solve the problem anyway, as warnings can still occur.
That said, it's of course nice to see Gtk warn you about potentially dangerous stuff, but my program is both interactive CLI and Gtk, so every issued warning results in a pretty horrible experience.
Because of that, I wish to completely silence Gtk with its API in production and live with the implications. Is this possible somehow?
...to elaborate a bit on that: The bindings are highly unusual https://github.com/phil294/gtk3.cr and the packaging tool for GTK is also pretty uncommon https://github.com/linuxdeploy/linuxdeploy-plugin-gtk, so warnings seem pretty much unavoidable. Thus the desire to simply silence them out.