Ideally, check what size the vertical box housing the entries would expand to before it actually expands.
As you keep adding new entries to a Vertical Box, the VB keeps expanding. Normally, before you add a new entry, you’d compare the size of the VB + Entry size against the size of the page. If the newVB size would to exceed the page size, add the new entry to the next page instead.
However, since each entry can have a different size and you only know the desired entry size after the user has punched in the text, you may need to compare container sizes after adding the entry.
Pseudo code:
- add the new entry as you normally would
- check if the VB size exceeds the page size now
- if it does not, fine, you have space left, do nothing else
- if it does exceed and would cause overlapping:
- create a new page
- re-parent the offending entry by adding it as a child to the next page’s VB
The last bit above will remove the entry from the last page (where it overlaps) and add it to the next page automatically. A widget can only have one direct parent at a time - take advantage of that.
Since this will happen within the same frame, you should not see a glitch when the container expends beyond the size of the page and then shrinks back.
If it does, do let me know, there will be a way to counter that.