3

I am using Python 3.6 and Gtk+ 3.22.18 on macOS Sierra 10.12.4 (both Python and Gtk+ installed via Homebrew). I've found that neither the GTK_DEBUG environment variable, nor the --gtk-debug argument have any effect. However:

  • They work for non-python apps, e.g. GTK_DEBUG=modules gtk3-demo
  • --gdk-debug and other arguments do work
  • Other environment variables are respected, e.g. GTK_THEME.

Only this doesn't work:

GTK_DEBUG=modules python hello.py

I'm pretty sure I'm using the same Gtk+ libraries for python and non-python apps. I've performed a search and only found one set of them.

I know Homebrew compiles Gtk+ with --enable-debug=minimal. To make sure that is not the culprit, I recompiled it without that flag, and can now use the Gtk inspector with --gtk-debug=interactive - but still only in C apps, not in Python apps. How can I use GTK_DEBUG?

jdm
  • 9,470
  • 12
  • 58
  • 110
  • Did you `export` `GTK_DEBUG`? – cdarke Aug 15 '17 at 12:14
  • I've set it correctly. In bash either `GTK_DEBUG=interactive gtk3-demo` or `export GTK_DEBUG=interactive; gtk3-demo`. For good measure, I've tried both, but they do the same. – jdm Aug 15 '17 at 12:25
  • For me also it didn't work. But `GTK_DEBUG=interactive python3 myscript.py` works fine – J Arun Mani Nov 09 '19 at 13:06

0 Answers0