Is it possible to "include" GTK UI XML fragment from other one?

Essentially I want a way to

  1. Reuse UI subdivisions without creating 2 GtkBuilder instance out of the same XML file and assemble stuffs programmatically.
  2. Avoid indentation hell in a single large XML.

Is that possible for now? I’m working with GTK4 nightly.

I’m awared of certain XML standard construct that makes possible XML inclusion if processed by a conforming XML parser. Does this work for GTK with GResource?

No, you can’t use XInclude or other XML tricks.

The proper way to reduce complexity in UI definition files is to split widgets into separate classes and use composite widget templates.

2 Likes

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