'Tkinter Text Widget - Adding Lines and Annotations Dynamically

I wish to add separator lines and annotations to a Tkinter Text widget, like what is shown in the image, which I created with photoshop to illustrate. Is there a way this can be done with Tkinter? Text widget with lines and annotations



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source