Popular recipes by Peter Mojeiko http://code.activestate.com/recipes/users/4190241/2014-07-18T11:39:51-07:00ActiveState Code RecipesAccordion Widget (Tkinter) (Python) 2014-07-18T11:39:51-07:00Peter Mojeikohttp://code.activestate.com/recipes/users/4190241/http://code.activestate.com/recipes/578911-accordion-widget-tkinter/ <p style="color: grey"> Python recipe 578911 by <a href="/recipes/users/4190241/">Peter Mojeiko</a> (<a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). </p> <p>An expanding/collapsing widget for Tkinter.</p> <p>usage:</p> <pre class="prettyprint"><code>from accordion import Accordion, Chord root = Tk() accordion = Accordion(root) accordion.pack() chord1 = Chord(accordion, title='Chord') # create widgets and give them chord1 as parent accordion.append_chords([chord1]) root.mainloop() </code></pre> <p>There's a more detailed example at the bottom of the file.</p> SuperText - Scrollable text with pop-up menu and themes for Tkinter (Python) 2014-06-20T16:25:43-07:00Peter Mojeikohttp://code.activestate.com/recipes/users/4190241/http://code.activestate.com/recipes/578897-supertext-scrollable-text-with-pop-up-menu-and-the/ <p style="color: grey"> Python recipe 578897 by <a href="/recipes/users/4190241/">Peter Mojeiko</a> (<a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/text_enriched/">text_enriched</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). </p> <p>Two things I consistently need when using a Text widget are scrollbars and pop-up menus. I've been adding them in on the fly for a while, but I think this class provides an easier way to implement these features.</p> <p>I also added a couple of very minimal themes:</p> <pre class="prettyprint"><code>1. The terminal theme replaces the standard Text cursor with a blocky-style insert cursor 2. The typewriter theme takes any text that has been inserted before it is called and types it to the widget, one character at a time </code></pre> <p>There's an example of use at the bottom of the code.</p>