Fun stuff: GtkConstraintLayout, the equivalent of Apple's AutoLayout and Android's ConstraintLayout, has landed in GTK's master branch, and will be available in the next major release:

There's going to be a blog post on the development blog soon.


Started working on it in late 2016, as a separate library for GTK 3, to be used by Endless for their applications. After writing the layout manager delegate class, I've spent the last 3 months cleaning up the solver and the various moving pieces; with the help of Matthias Clasen, we finally got it merged today, with a lot more features.

· · Web · 1 · 3 · 5

Maybe, at some point, we'll also get an integrated constraint editor in Glade or GNOME Builder… That would be neat, and would make writing GNOME apps a more pleasant experience

Of course, constraint layouts have a cost. Specialised, finely tuned layout managers beat general purpose ones. If you're shoving 100s of rows in a list box, you probably want to keep using the GtkListBox widget; but if you have a form view, or a complex UI with a known set of widgets, do give constraints a try, and you can avoid lots of nested boxes and messing around with alignment and expansion flags

Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!