Gtk-builder-tool, requires and libraries

I’m trying to improve my CI/test setup and would like to validate my .ui files.

Unfortunately, I cannot get gtk-builder-tool validate to work with libraries.

Here is an example

<!-- example.ui -->
<?xml version="1.0" encoding="UTF-8" ?>
<interface>
  <requires lib="gtk" version="4.0" />
  <requires lib="Adw" version="1.0" />
  <object class="AdwApplicationWindow" id="window"/>
</interace>
> gtk-builder-tool validate example.ui
example.ui:6:53 Invalid object type 'AdwApplicationWindow'

Is there a solution?

The documentation states

The target toolkit version(s) are described by <requires> elements, the “lib” attribute specifies the widget library in question (currently the only supported value is “gtk”) and the “version” attribute specifies the target version in the form “<major>.<minor>”. GtkBuilder will error out if the version requirements are not met.

But I’ve seen GNOME Core application use <requires lib="Adw" version="1.0" />. What is the purpose of non gtk <requires/> ?

Thank you

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.