Popular recipes tagged "autoresize"http://code.activestate.com/recipes/tags/autoresize/popular/2016-12-10T15:40:25-08:00ActiveState Code RecipesAutomatic resized Text widget (Tkinter) (Python)
2016-12-10T15:40:25-08:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/578886-automatic-resized-text-widget-tkinter/
<p style="color: grey">
Python
recipe 578886
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/autoresize/">autoresize</a>, <a href="/recipes/tags/text/">text</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 14.
</p>
<p>The Text widget resize to its contents.
Based on this:
<a href="https://stackoverflow.com/questions/11544187/tkinter-resize-text-to-contents" rel="nofollow">https://stackoverflow.com/questions/11544187/tkinter-resize-text-to-contents</a></p>
<p>But here there is one important improvement:
The widget resize first, before a character inclusion.</p>
<p>For this trick I have had to use tag bindings.</p>
<p>Here there is a practical application of this widget:</p>
<p><a href="https://code.activestate.com/recipes/578885-draggable-desktop-note-or-sticky-notes-in-tkinter/" rel="nofollow">https://code.activestate.com/recipes/578885-draggable-desktop-note-or-sticky-notes-in-tkinter/</a></p>