Reputation: 317
Everything inside my application is laid out using sizers with hard-coded border sizes. This makes it fit very nicely inside Windows with wxWidgets:
But when I started porting it to Linux with wxGTK, since GTK+3 elements can vary a lot in size, everything ends up being misaligned:
Is there a way to responsively layout items taking into account that controls can be in different sizes, and the discrepancies between points and pixels as units of measurement?
Upvotes: 0
Views: 249
Reputation: 22688
You can't hard code any sizes to have a fighting chance of a layout working well on different platforms with different font sizes, DPI settings etc. If you're defining your layout in C++, use wxSizerFlags::Border()
, DoubleBorder()
etc methods. Also, align controls relatively to each other, e.g. using Center()
for all the controls that should be in the same row (or use wxFlexGridSizer
).
Upvotes: 1