Projects/GTK/Inspector - GNOME Wiki!

submited by
Style Pass
2021-07-24 02:00:05

GtkInspector is the built-in interactive debugging support in GTK+. It was added in GTK+ 3.14, based on a copy of the well-established gtkparasite.

The debugger is disabled by default. To enable it, make sure you have the libgtk-3-dev(debian-naming) or gtk3-devel(fedora-naming) package installed and run in a terminal: gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true

If the application you are using happens to be a Flatpak it will likely have a separate GSettings storage than your host system, you will need to modify that environment separately like the following.

If you are developing the application via Gnome Builder, open the "Runtime terminal" from the "Open Menu", and run the same gsetting command.

To launch the GTK Inspector, focus your GTK application and press Control-Shift-D. Alternatively, move your mouse cursor to your desired widget and press Control-Shift-I to specifically inspect the widget under the mouse cursor.

If you don't want to use the shortcuts, you can also open the Inspector directly when running your app with: GTK_DEBUG=interactive your-app

Leave a Comment