[Tkinter-discuss] Techniques for creating tables/grids (was When to use a Canvas vs. a Frame from a container perspective?)

Michael Lange klappnase at web.de
Mon Dec 20 18:24:55 CET 2010


Thus spoketh python at bdurham.com 
unto us on Mon, 20 Dec 2010 11:41:11 -0500:

> Cameron,
> 			.
> > While many valuable applications have been coded through the years
> > using exactly this cell-in-Text technique, and the code above nicely
> > demonstrates the promised scrolling, those focused on
> > spreadsheet-like constructs will want to know about <URL:
> > http://tkinter.unpythonic.net/wiki/TkTable >.
> What is your opinion on using the new ttk Treeview control to implement
> multi-cell tables and grids?
> My understanding is that one can configure the Treeview control as a
> single level, multi-column list/grid and then float a borderless
> Toplevel window with an input widget over the current Treeview "cell" to
> allow for input? Disclaimer: I haven't tried this yet.

Tktreectrl has a built-in feature that does exactly what you describe.
However to make it really functional it requires some extra tweaking by
the programmer and it is also relativeley slow. Obviously it is designed
for occasional use , e.g. explorer-alike file renaming in a directory

To add this from scratch for the ttk.Treeview and building a spreadsheet
from it will probably be quite a lot of work for a relatively poor result.
For a very simple spreadsheet widget that comes with the standard library
the Tix.Grid seems to be the widget of choice. If this is not capable
enough I believe tktable is the best bet.



.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Insults are effective only where emotion is present.
		-- Spock, "Who Mourns for Adonais?"  stardate 3468.1

More information about the Tkinter-discuss mailing list