Hi,
you could study the image widget (a very basic widget) and its cross management so that you should be able to reproduce the management with the text widget.
In general, for contributors, we suggest to make a fork on GitHub and make a pull request with your final code.
Thank you.