← Back to context

Comment by vbezhenar

1 day ago

This Babylonian tower will crumble one day.

Layout does not have to be so complex. There are dozens of GUI frameworks with simpler layout system. Those are enough for applications everyone uses.

Actually, almost every GUI toolkit's scheme for layout has issues, and none of them are perfect.

The ones that use absolute pixel positioning fail when using different resolution displays.

The ones that use box packing fail when you need to deal with different sized displays.

The ones that use constraint programming fail when you need to layout hundreds or thousands of widgets.

CSS-style layout has its own pros and cons, but there is no alternative to it that is clearly better under all circumstances. If you doing layout and want to be resolution-independent, function on everything from phones to giant displays and have thousands of things to layout, CSS is actually likely better than any alternative.

And they all have massive issues, or just provide a worse version of CSS (QT's qss, for example, as it's just a less well documented, non standard and very sparsely talked about CSS implementation. Oh and it doesn't work for everything in QT)

Pixel positioning is so nice! I remember how easy it was to layout UIs with VB.

  • How does that work when someone resizes a window? I'm genuinely asking because pixel positioning to me sounds like hardcoding positions. Do you have to manually code the reflow when the window becomes narrow for example?