The .reflow() callback is called whenver the .position of a widget changes.
You MUST NOT call reflow() yourself, to do that use .position = someRect.
However but you can override it and if you want a resizeable UI you will have at least one .reflow() override in your gui.d.
The role of this method is to update positions of children, hence you can implement any kind of descending layout.
Inside this call, getting own position with .position() is encouraged.
Pseudo-code:
override void reflow() { box2i p = this.position(); childn.position = something(p) }
Note: Widget positions are absolute. As such, children don't need to be inside position of their parent at all.
position
See Implementation
The .reflow() callback is called whenver the .position of a widget changes.
You MUST NOT call reflow() yourself, to do that use .position = someRect.
However but you can override it and if you want a resizeable UI you will have at least one .reflow() override in your gui.d.
The role of this method is to update positions of children, hence you can implement any kind of descending layout.
Inside this call, getting own position with .position() is encouraged.
Pseudo-code:
override void reflow() { box2i p = this.position(); childn.position = something(p) }
Note: Widget positions are absolute. As such, children don't need to be inside position of their parent at all.