Most viewed recipes by Miguel Martínez López http://code.activestate.com/recipes/users/4189907/views/2017-06-19T18:22:01-07:00ActiveState Code RecipesTkinter table with scrollbars (Python)
2017-05-06T19:06:05-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580793-tkinter-table-with-scrollbars/
<p style="color: grey">
Python
recipe 580793
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/scrollbars/">scrollbars</a>, <a href="/recipes/tags/table/">table</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 13.
</p>
<p>I created here a tkinter table with scrollbar support. I use one of my other recipes for the mousewheel support and scrolling:</p>
<p><a href="https://code.activestate.com/recipes/580640-scrolling-frame-with-mouse-wheel-support" rel="nofollow">https://code.activestate.com/recipes/580640-scrolling-frame-with-mouse-wheel-support</a></p>
Frame with border color for Tkinter (Python)
2017-04-17T11:25:02-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580735-frame-with-border-color-for-tkinter/
<p style="color: grey">
Python
recipe 580735
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/border/">border</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
</p>
<p>This trick show how to add a border color to frame. These are the important configurations:</p>
<pre class="prettyprint"><code> highlightbackground="your border color here"
highlightcolor="your border color here"
highlightthickness="the border width"
bd= 0
</code></pre>
Tkinter table (Python)
2017-05-02T21:19:51-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580786-tkinter-table/
<p style="color: grey">
Python
recipe 580786
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/table/">table</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 24.
</p>
<p>Table of data for tkinter.</p>
<p>Here there is an improved vesion with vertical scrollbar support:</p>
<p><a href="https://code.activestate.com/recipes/580793-tkinter-table-with-scrollbars" rel="nofollow">https://code.activestate.com/recipes/580793-tkinter-table-with-scrollbars</a></p>
Simple multicolumn listbox for tkinter (Python)
2017-05-02T22:27:15-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580794-simple-multicolumn-listbox-for-tkinter/
<p style="color: grey">
Python
recipe 580794
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/listbox/">listbox</a>, <a href="/recipes/tags/multicolumn/">multicolumn</a>, <a href="/recipes/tags/table/">table</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
</p>
<p>This recipe makes easy to work a treeview widget like a table.</p>
<p>It has several options for styling:</p>
<ul>
<li>heading_anchor</li>
<li>heading_font</li>
<li>heading_background</li>
<li>heading_foreground</li>
<li>cell_anchor</li>
<li>cell_background</li>
<li>cell_foreground</li>
<li>cell_font</li>
<li>cell_pady</li>
<li>height</li>
<li>padding</li>
<li>adjust_heading_to_content</li>
<li>stripped_rows</li>
<li>headers</li>
<li>selection_background</li>
<li>selection_foreground</li>
<li>field_background</li>
</ul>
<p>The "command" parameter is a callback and its called each time a row is selected.</p>
Tkinter frame with different border sizes (Python)
2017-05-06T18:45:00-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580798-tkinter-frame-with-different-border-sizes/
<p style="color: grey">
Python
recipe 580798
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/border/">border</a>, <a href="/recipes/tags/size/">size</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
</p>
<p>This trick shows how to create a bordered frame with different border size in each side.</p>
Text widget width and height in pixels (Tkinter) (Python)
2016-12-11T13:39:08-08:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/578887-text-widget-width-and-height-in-pixels-tkinter/
<p style="color: grey">
Python
recipe 578887
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/text/">text</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 8.
</p>
<p>The solution consists in putting the Text widget inside a frame, forcing the frame to a fixed size by deactivating size propagation and configuring the Text widget to expand and fill both directions (to stick to the frame borders).</p>
<p><a href="https://stackoverflow.com/questions/14887610/how-to-specify-the-dimensions-of-a-tkinter-text-box-in-pixels" rel="nofollow">https://stackoverflow.com/questions/14887610/how-to-specify-the-dimensions-of-a-tkinter-text-box-in-pixels</a></p>
Scrolled Frame V2 (Python)
2017-05-06T18:54:47-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580797-scrolled-frame-v2/
<p style="color: grey">
Python
recipe 580797
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/scrolling/">scrolling</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 4.
</p>
<p>This is another version of scrolled frame. It doesn't use Canvas. Instead it does the trick using place geometry manager.</p>
<p>Based on these codes:</p>
<ul>
<li><p>https://github.com/alejandroautalan/pygubu/blob/master/pygubu/widgets/tkscrolledframe.py</p></li>
<li><p>http://wiki.tcl.tk/9223 </p></li>
</ul>
<p>This is my other version of scrolled frame:</p>
<p><a href="https://code.activestate.com/recipes/580640-scrolling-frame-with-mouse-wheel-support/" rel="nofollow">https://code.activestate.com/recipes/580640-scrolling-frame-with-mouse-wheel-support/</a></p>
bind all tkinter "bug" (Python)
2017-05-05T20:33:31-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580795-bind-all-tkinter-bug/
<p style="color: grey">
Python
recipe 580795
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/all/">all</a>, <a href="/recipes/tags/bind/">bind</a>, <a href="/recipes/tags/binding/">binding</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 3.
</p>
<p>This recipes tries to solve the problem of bind_all and unbind_all for tkinter.</p>
<p>When a callback is registered using bind_all method and later it's unregistered using unbind_all, all the callbacks are deleted for the "all" tag event. This makes difficult to register and unregister only one callback at a time. This recipes tries to solve this problem.</p>
<p>Observe the difference between the code below and the recipe. With the code below, when the user clicks nothing happens. But with my recipe it's possible to bind and unbind specific callbacks.</p>
<pre class="prettyprint"><code>try:
from Tkinter import Tk, Frame
except ImportError:
from tkinter import Tk, Frame
root = Tk()
f = Frame(root, width= 300, height=300)
f.pack()
def callback1(event):
print("callback1")
def callback2(event):
print("callback2")
def callback3(event):
print("callback3")
root.bind_all("<1>", callback1, add="+")
f.bind_all("<1>", callback2, add="+")
f.bind_all("<1>", callback3, add="+")
f.unbind_all("<1>")
root.mainloop()
</code></pre>
Tkinter treeview like a table or multicolumn listbox (Python)
2017-05-02T22:27:48-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580746-tkinter-treeview-like-a-table-or-multicolumn-listb/
<p style="color: grey">
Python
recipe 580746
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/editable/">editable</a>, <a href="/recipes/tags/listbox/">listbox</a>, <a href="/recipes/tags/megawidget/">megawidget</a>, <a href="/recipes/tags/multicolumn/">multicolumn</a>, <a href="/recipes/tags/table/">table</a>, <a href="/recipes/tags/tkinter/">tkinter</a>, <a href="/recipes/tags/treeview/">treeview</a>).
Revision 33.
</p>
<p>This trick provides use my other recipe:</p>
<p><a href="https://code.activestate.com/recipes/580794-simple-multicolumn-listbox-for-tkinter/" rel="nofollow">https://code.activestate.com/recipes/580794-simple-multicolumn-listbox-for-tkinter/</a></p>
<p>This recipes defines a <em>Tk_Table:</em> A table that extends the multicolumn listbox adding row numbers, making the cells editable and adding autoscrollbars.</p>
<p><em>Tk_Table</em></p>
<p>It has the same options than <em>Multicolumn_Listbox</em>, and some extra parameters to configure the new functionality.</p>
<p>Setting the editable keyword to True, makes the widget editable.</p>
<p>If you want stripped rows, pass the stripped_rows with a tuple (or list) of two colors.</p>
<p>If you want row numbers, then pass to <em>row_numbers</em> parameter a True value.</p>
<p>These are the extra options for this class:</p>
<ul>
<li>entry_background</li>
<li>entry_foreground</li>
<li>entry_validatecommand</li>
<li>entry_selectbackground</li>
<li>entry_selectborderwidth</li>
<li>entry_selectforeground</li>
<li>scrollbar_background</li>
<li>scrollbar_troughcolor</li>
<li>rowlabel_anchor</li>
<li>rowlabel_minwidth</li>
<li>rowlabel_hoverbackground</li>
<li>frame_relief</li>
<li>frame_borderwidth</li>
<li>frame_background</li>
<li>row_numbers</li>
</ul>
Automatic 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>
Tkinter Datepicker (like the jQuery UI datepicker) (Python)
2017-06-19T18:22:01-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580725-tkinter-datepicker-like-the-jquery-ui-datepicker/
<p style="color: grey">
Python
recipe 580725
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/calendar/">calendar</a>, <a href="/recipes/tags/datepicker/">datepicker</a>, <a href="/recipes/tags/megawidget/">megawidget</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 18.
</p>
<p>It's based on ttkcalendar.py. But the internals are totally changed.I don't use for example the Treeview widget. I added more features also:</p>
<ul>
<li>On mouse over, the day label changes the background</li>
<li>The selected day has an outstanding style</li>
<li>Added support for many hotkeys</li>
</ul>
<p>These are the default bindings:</p>
<ul>
<li><p><em>Click button 1 on entry:</em> Show calendar</p></li>
<li><p><em>Click button 1 outside entry and calendar:</em> Hide calendar</p></li>
<li><p><em>Escape:</em> Hide calendar</p></li>
<li><p><em>CTRL + PAGE UP:</em> Move to the previous month.</p></li>
<li><p><em>CTRL + PAGE DOWN:</em> Move to the next month.</p></li>
<li><p><em>CTRL + SHIFT + PAGE UP:</em> Move to the previous year.</p></li>
<li><p><em>CTRL + SHIFT + PAGE DOWN:</em> Move to the next year.</p></li>
<li><p><em>CTRL + LEFT:</em> Move to the previous day.</p></li>
<li><p><em>CTRL + RIGHT:</em> Move to the next day.</p></li>
<li><p><em>CTRL + UP:</em> Move to the previous week.</p></li>
<li><p><em>CTRL + DOWN:</em> Move to the next week.</p></li>
<li><p><em>CTRL + END:</em> Close the datepicker and erase the date.</p></li>
<li><p><em>CTRL + HOME:</em> Move to the current month.</p></li>
<li><p><em>CTRL + SPACE:</em> Show date on calendar</p></li>
<li><p><em>CTRL + Return:</em> Set current selection to entry</p></li>
</ul>
Image background for tkinter (Python)
2017-04-12T19:37:06-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580782-image-background-for-tkinter/
<p style="color: grey">
Python
recipe 580782
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/background/">background</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 3.
</p>
<p>This is only a proof of concept.</p>
<p>In my first example, PIL is required. I use PIL also to draw the text over the background. I use the place geometry manager to position the entry.</p>
<p>In my second example, I use a canvas widget to draw text over image. I also use the canvas to create other widgets over the background.</p>
Tkinter search box (Python)
2017-04-08T12:27:36-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580773-tkinter-search-box/
<p style="color: grey">
Python
recipe 580773
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/entry/">entry</a>, <a href="/recipes/tags/search/">search</a>, <a href="/recipes/tags/searchbox/">searchbox</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 9.
</p>
<p>Instead of using two colors for active background and normal background, I use only one color and opacity parameter.</p>
<p>I trigger the feeling of a button using different colors when the mouse is and isn't over. Many modern HTML search boxes uses the same approach.</p>
<p>Command function receives text of entry box when button is pressed.</p>
Tkinter Animated GIF (Python)
2017-04-10T11:27:05-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580708-tkinter-animated-gif/
<p style="color: grey">
Python
recipe 580708
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/gif/">gif</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 10.
</p>
<p>Tkinter GIF in motion. It uses the "after" command of Tcl and PIL.</p>
<p>Add path to GIF to make the example working.</p>
Mousewheel binding to scrolling area Tkinter (multiplatform) (Python)
2017-05-16T18:18:31-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/578894-mousewheel-binding-to-scrolling-area-tkinter-multi/
<p style="color: grey">
Python
recipe 578894
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/mousewheel/">mousewheel</a>, <a href="/recipes/tags/scrollbar/">scrollbar</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 28.
</p>
<p>The behaviour of the mouse wheel is similar to the one on Windows.</p>
<p>I tested this program on Windows 7 and on Linux Mint 17. Please let me know if this code doesn't work on your platform. I will appreciate any comments.</p>
<p>This is a practical application of this recipe: a scrolling frame with mouse wheel support.</p>
<p><a href="https://code.activestate.com/recipes/580640-scrolling-frame-with-mouse-wheel-support" rel="nofollow">https://code.activestate.com/recipes/580640-scrolling-frame-with-mouse-wheel-support</a></p>
Tkinter frame with gradient (Python)
2017-03-11T03:43:56-08:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580761-tkinter-frame-with-gradient/
<p style="color: grey">
Python
recipe 580761
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/canvas/">canvas</a>, <a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/gradient/">gradient</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 4.
</p>
<p>Frame with linear gradient using PIL. </p>
<p>It's also possible to make the same trick using tkinter PhotoImage.</p>
<p><a href="http://stackoverflow.com/questions/10417524/why-is-photoimage-put-slow" rel="nofollow">http://stackoverflow.com/questions/10417524/why-is-photoimage-put-slow</a></p>
<p>But PIL is more efficient:</p>
<p><a href="https://groups.google.com/forum/#%21topic/comp.lang.python/nQ6YO-dTz10" rel="nofollow">https://groups.google.com/forum/#!topic/comp.lang.python/nQ6YO-dTz10</a></p>
<p>Possible values for <strong>orient</strong> are: <em>VERTICAL</em>, <em>HORIZONTAL</em>. If <strong>orient</strong> is "vertical", then width is mandatory. If <strong>orient</strong> is "horizontal", then height is mandatory. If <strong>steps</strong> is <em>None</em>, then the gradient is composed of adjacent lines.</p>
<p>One possible practical application of gradient frames are tool bars. Gradient guives a visual clue of when an area starts and when an area finish. </p>
Tkinter Link or Hyperlink Button (Python)
2017-04-07T11:51:26-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580774-tkinter-link-or-hyperlink-button/
<p style="color: grey">
Python
recipe 580774
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/button/">button</a>, <a href="/recipes/tags/hyperlink/">hyperlink</a>, <a href="/recipes/tags/link/">link</a>, <a href="/recipes/tags/tkinter/">tkinter</a>, <a href="/recipes/tags/webbrowser/">webbrowser</a>).
Revision 6.
</p>
<p>If a background is not provided, the widget gets the background color from its container. The link button has two states: normal and visited. When the link is clicked, the state change to visited. When the link is clicked the action command is called. By default the text of the link has an underline. There is several options for customization.</p>
<p>I also added this megawidget to my "Metro UI Tkinter" recipe:</p>
<p><a href="https://code.activestate.com/recipes/580729-metro-ui-tkinter" rel="nofollow">https://code.activestate.com/recipes/580729-metro-ui-tkinter</a></p>
File browser for tkinter using idle GUI library (Python)
2017-04-03T13:37:34-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580772-file-browser-for-tkinter-using-idle-gui-library/
<p style="color: grey">
Python
recipe 580772
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/browser/">browser</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/idlelib/">idlelib</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
</p>
<p>Idle is installed by default on windows.</p>
<p>For Ubuntu, Linux Mint and Debian run:</p>
<pre class="prettyprint"><code> sudo apt-get install idle-python2.7
</code></pre>
<p>A tree structure is drawn on a Tkinter Canvas object. A tree item is an object with an icon and a text. The item maybe be expandable and/or editable. A tree item has two kind of icons: A normal icon and an icon when the item is selected. To create the tree structure, it's necessary to create a link between tree items, using a parent-child relationship. </p>
<p>The canvas is built using a <em>idlelib.TreeWidget.ScrolledCanvas</em> class. The <em>frame</em> attribute of this object contains a <em>Frame</em> Tkinter widget prepared for scrolling. This frame allocates a Tkinter <em>Canvas</em> and Tkinter <em>Scrollbars</em>. This is the signature:</p>
<pre class="prettyprint"><code> ScrolledCanvas(master, **options_for_the_tkinter_canvas)
</code></pre>
<p>It accepts exactly the same arguments than a <em>Canvas</em> widget.</p>
<p>A tree item should be a subclass of <em>idlelib.TreeWidget.TreeItem</em>.</p>
<p>The parent-child relationship between tree items is established using the <em>idlelib.TreeWidget.TreeNode</em> class.</p>
<p>This is the signature for <strong>TreeNode(canvas, parent, item)</strong>:</p>
<ul>
<li><em>canvas</em> should be a <em>ScrolledCanvas</em> instance. </li>
<li><em>parent</em> should be the parent item. Leave that to <em>None</em> to create a root node.</li>
<li><em>item</em> should be the child item</li>
</ul>
<p><em>FileTreeItem</em> is a type of <em>TreeItem</em>. The only argument of a file tree item is a path.</p>
<p>Here there is an example of a custom tree item:</p>
<p><a href="https://code.activestate.com/recipes/579077-bookmarks-browser-for-firefox/" rel="nofollow">https://code.activestate.com/recipes/579077-bookmarks-browser-for-firefox/</a></p>
<p>To create your own tree items, it's required to subclass <em>TreeItem</em>. These are the methods that should be overrided:</p>
<ul>
<li><em>GetText:</em> It should return the text string to display.</li>
<li><em>GetLabelText:</em> It should return label text string to display in front of text (Optional).</li>
<li><em>IsExpandable:</em> It should return a boolean indicating whether the istem is expandable</li>
<li><em>IsEditable:</em> It should return a boolean indicating whether the item's text may be edited.</li>
<li><em>SetText:</em> Get the text to change if the item is is editable</li>
<li><em>GetIconName:</em> Return name of icon to be displayed normally (Icons should be included in <em>ICONDIR</em> directory)</li>
<li><em>GetSelectedIconName:</em> Return name of icon to be displayed when selected (Icons should be included in <em>ICONDIR</em> directory).</li>
<li><em>GetSubList:</em> It should return a list of child items (Optional. If not defined, the element is not expandable)</li>
<li><em>OnDoubleClick:</em> Called on a double-click on the item. (Optional)</li>
</ul>
<p>Icons should be included in "Icons" subdirectory of path to idlelib library. If you want to use other path, just change <em>ICONDIR</em> variable to path to your icons:</p>
<pre class="prettyprint"><code> import idlelib
idlelib.ICONDIR = "Your path to your icons"
</code></pre>
<p>Run this to find the path to <em>idlelib</em> module:</p>
<pre class="prettyprint"><code> python -c "import idlelib; print(idlelib.__file__)"
</code></pre>
Scrolling frame with mouse wheel support (Python)
2017-05-16T18:15:44-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580640-scrolling-frame-with-mouse-wheel-support/
<p style="color: grey">
Python
recipe 580640
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/frame/">frame</a>, <a href="/recipes/tags/mousewheel/">mousewheel</a>, <a href="/recipes/tags/scrolling/">scrolling</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 26.
</p>
<p>Scrolling frame in Tkinter with mouse wheel support for different platforms.</p>
XML viewer for Tkinter or XML treeview (Python)
2017-02-22T23:00:21-08:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580752-xml-viewer-for-tkinter-or-xml-treeview/
<p style="color: grey">
Python
recipe 580752
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/browser/">browser</a>, <a href="/recipes/tags/tkinter/">tkinter</a>, <a href="/recipes/tags/treeview/">treeview</a>, <a href="/recipes/tags/viewer/">viewer</a>, <a href="/recipes/tags/xml/">xml</a>).
Revision 3.
</p>
<p>Tk widget to display XML for Python. I use the treeview widget. There is no external dependency.I also added support for autoscrollbars.</p>