- Python GUI Programming Cookbook(Second Edition)
- Burkhard A. Meier
- 69字
- 2021-07-09 19:50:58
How to do it...
By adding the following lines of code, we create a ScrolledText widget:
GUI_scrolledtext_widget.py

We can actually type into our widget, and if we type enough words, the lines will automatically wrap around:

Once we type in more words than the height the widget can display, the vertical scrollbar becomes enabled. This all works out-of-the-box without us needing to write any more code to achieve this:
