Popular recipes tagged "listbox"http://code.activestate.com/recipes/tags/listbox/2017-05-02T22:27:48-07:00ActiveState Code RecipesSimple 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 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> Ordered Listbox for Tkinter (Python) 2017-02-11T19:01:52-08:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580756-ordered-listbox-for-tkinter/ <p style="color: grey"> Python recipe 580756 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/listbox/">listbox</a>, <a href="/recipes/tags/ordered/">ordered</a>, <a href="/recipes/tags/sort/">sort</a>, <a href="/recipes/tags/sorted/">sorted</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 6. </p> <p>Listbox megawidget showing ordered strings. It's possible to ignore case. I also provided an auto scrollbar option.</p> Metro Listbox (Python) 2017-04-16T16:48:22-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580785-metro-listbox/ <p style="color: grey"> Python recipe 580785 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/listbox/">listbox</a>, <a href="/recipes/tags/metro/">metro</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 2. </p> <p>I provide an alternative listbox for tkinter.</p> <p>Using this trick you can add horizontal and vertical padding to every item and also a width.</p> Setting up a listbox filter in Tkinter(python 2.7) (Python) 2014-04-10T10:25:38-07:00Wyklephhttp://code.activestate.com/recipes/users/4189735/http://code.activestate.com/recipes/578860-setting-up-a-listbox-filter-in-tkinterpython-27/ <p style="color: grey"> Python recipe 578860 by <a href="/recipes/users/4189735/">Wykleph</a> (<a href="/recipes/tags/filter/">filter</a>, <a href="/recipes/tags/listbox/">listbox</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/search/">search</a>, <a href="/recipes/tags/searchbar/">searchbar</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 3. </p> <p>If you have a listbox and need to filter the contents of the listbox based on the contents of an entry field, this will help you! Shoutout to Nikola-K for the revision. It's much simpler now :D</p>