gtk4-builder-tool(1)
π gtk4-builder-tool β the GtkBuilder File Utility π
okay bestie, so this little icon is part of the GTK commands lineup, and honestly? it's the backstage pass to your GtkBuilder files. let's get into it π
β¨ SYNOPSIS β¨
gtk4-builder-tool <COMMAND> [OPTIONS...] <FILE>
gtk4-builder-tool validate [OPTIONS...] <FILE>
gtk4-builder-tool enumerate [OPTIONS...] <FILE>
gtk4-builder-tool simplify [OPTIONS...] <FILE>
gtk4-builder-tool preview [OPTIONS...] <FILE>
gtk4-builder-tool render [OPTIONS...] <FILE>
gtk4-builder-tool screenshot [OPTIONS...] <FILE>
like, you pick a COMMAND, toss in some [OPTIONS...], point it at your <FILE> and let it cook π
πΈ DESCRIPTION πΈ
gtk4-builder-tool is the girl who can do β¨various operationsβ¨ on GtkBuilder UI definition files. that's the whole vibe. she runs errands on your UI files and she does not miss. π«Ά
π COMMANDS π
π Validation
bestie the validate command is your vibe check π
it validates the given UI definition file and reports errors to stderr β so if something's messy, it will read you for filth. (lovingly. it's constructive.)
real talk tho, there are limitations to the validation that can be done for templates, because templates are closely tied to theclass_initfunction they are used in. and if your UI file uses types from third-party libraries? it may help to add those libraries to theLD_PRELOADenvironment variable. noted, queen. π
--deprecationsβ warn about uses of deprecated types in the UI definition file. she's giving you the heads up, not the silent treatment. β
π¦ Enumeration
the enumerate command prints all the named objects that are present in the UI definition file. like a roll call for your UI. everybody say present πββοΈ
--callbacksβ print the names of callbacks as well. now those besties get named too π
π Preview
the preview command displays the UI definition file. literally shows you the fit in the mirror π
this command accepts options to specify the ID of the toplevel object and a CSS file to use.
--id=ID β the ID of the object to preview. if you don't specify it,gtk4-builder-toolwill choose a suitable object on its own. she's got taste, trust her. β¨--css=FILE β load style information from the given CSS file. serve the looks. π
π₯ Render
the render command saves a rendering of the UI definition file as a png image or node file. the name of the file to write can be specified as a second FILE argument. yes bestie, two files. she's doing the most and we love that for her.
this command accepts options to specify the ID of the toplevel object and a CSS file to use.
--id=ID β the ID of the object to preview. if you don't specify it,gtk4-builder-toolwill choose a suitable object on its own. (yes, same energy as above. she's consistent. iconic.) π--css=FILE β load style information from the given CSS file. glow up incoming. π§--nodeβ write a serialized node file instead of a png image. different format, same queen. π--forceβ overwrite an existing file. she said move, respectfully. π
β Screenshot
the screenshot command is an alias for render. that's it, that's the whole thing β same girl, different name tag. main character energy either way. ππ
π Simplification
the simplify command simplifies the UI definition file by removing properties that are set to their default values and writes the resulting XML to the standard output, or back to the input file. declutter, cleanse, simplify, periodt. β¨
when the --3to4 option is specified, simplify interprets the input as a GTK 3 UI definition file and attempts to convert it to GTK 4 equivalents. it performs various conversions, such as renaming properties, translating child properties to layout properties, rewriting the setup for GtkNotebook, GtkStack, GtkAssistant or changing toolbars into boxes. it's a whole transformation arc and honestly? she ate. π₯
β οΈ okay this is the serious part and I mean it: you should always test the modified UI definition files produced by gtk4-builder-tool before using them in production. no cap. do not skip this. π
and note in particular that the conversion done with --3to4 is meant as a starting point for a port from GTK 3 to GTK 4. it is expected that you will have to do manual fixups after the initial conversion. she's your assistant, not your replacement, bestie. π
--replaceβ write the content back to the UI definition file instead of using the standard output. in-place edits, brave of you. π--3to4β transform a GTK 3 UI definition file to the equivalent GTK 4 definitions. glow-up machine. π¦
and that's the whole page, babe π this one ships with GTK and lives in the manual as gtk4-builder-tool(1) β go forth, validate your files, and slay πβ¨πΈπ
π«Ά
π¦ where this page comes from
- ubuntu stonking: libgtk-4-bin 4.24.1+ds-1 Β· LGPL-2.0-or-later AND LGPL-2.1-or-later AND sun-permissive AND lcs-telegraphics-permissive AND X11R5-permissive AND MIT AND BSD-3-clause-Google AND Apache-2.0 AND CC0-1.0 AND ZPL-2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms