For extension developers.
Most extensions to Inkscape use an .inx file that describes a static user interface, then a Python script is run one time when the user clicks "Apply".
To create a dynamic UI (that changes as the user clicks buttons, selects from dropdown menus, etc) you can build it in GTK using a Python script that runs immediately. Requires Inkscape v1.1 or newer.
These short examples demonstrate a handful of functions in GTK+ 3.
Now includes an example extension that uses a .glade XML file to create the UI with Gtk.Builder(). Also many small changes that result in much higher pylint code scores.