[erlang-questions] wxSizer

Tobias Schlager Tobias.Schlager@REDACTED
Wed Dec 7 09:58:35 CET 2016


Hi Peter,

I don't know much about the Erlang port of wxWidgets. However, I have done some work with native wxWidgets recently. From what I can see, the API seems to be a straight mapping to the C++ code. This would lead to the conclusion that the same rules and documentation can be applied to the Erlang port. To understand layout and spacing I would suggest starting with the 'Sizers Overview' [1]. You could also have a look at the zetcode tutorials [2] which are pretty good and easy to understand.

To address your specific question:
Windows (every UI element is a window in wxWidgets) and sizers appear in the order they are added to their (parent) sizer (not their parent window). The C++ library also has support to insert windows into sizers at a specific index. Usually, you simply add items in the order you want them to appear in the layout. The normal workflow is to create the UI elements, then add them to a sizer in the order you want them. After this you can add this sizer to another sizer or set it as the main sizer of the frame, finally layout the window.

Regards
Tobias

[1] http://docs.wxwidgets.org/stable/overview_sizer.html
[2] http://zetcode.com/gui/wxwidgets/


More information about the erlang-questions mailing list