Tree [r74] /
History



File Date Author Commit
Custom.py 2008-09-20 chido [r33] fix for sorting formulas
NumpyStats.py 2008-10-03 chido [r56] added a stats class
Prefs.py 2008-04-12 chido [r1] import
PylabPlot.py 2009-04-27 chido [r71] changes tablemodel init and pylab plot
README 2008-09-26 chido [r44] auto adjust cols to long strings when open
TableCell.py 2008-09-10 chido [r22] added cell class
TableFormula.py 2009-04-27 chido [r71] changes tablemodel init and pylab plot
TableModels.py 2010-04-24 chido [r74] added copy/paste cells
Table_images.py 2008-10-03 chido [r53] new icons
Tables.py 2010-04-24 chido [r74] added copy/paste cells
TablesApp.py 2008-10-03 chido [r53] new icons
Tables_IO.py 2008-09-03 chido [r15] more formula work
__init__.py 2008-09-26 chido [r43] added init file
scrsht.png 2008-04-12 chido [r1] import
setup.py 2008-09-26 chido [r44] auto adjust cols to long strings when open
tables_logo.png 2008-04-12 chido [r1] import
test.py 2009-12-14 chido [r72] import dict work

Read Me

ABOUT

There are various libraries that extend tkinter functionality, such as Pmw, but there is currently no useful and extendable table class for tkinter.
We have developed such a class out of the need to use one in our protein engineering (PEAT) application and it is provided here under the GPL license for general use.
A sample application using these classes is included in the distribution. This shows a possible implementation. Pmw is required to use this application. Otherwise the classes are based purely on tkinter.

HOMEPAGE

http://tkintertable.sourceforge.net/

SUBVERSION

You can checkout the current svn version using svn co https://tkintertable.svn.sourceforge.net/svnroot/tkintertable 

USAGE

The class utilises the concept of table view<->model from java swing.
The TableCanvas class is the graphical element that handles all the user interaction, GUI changes, formatting etc. This class inherits from tkinter canvas, and we should put all basic table functionality in this base class. However, in practice we really should sub-class this and add any specialist functionality to the subclass, either by overriding the required parent class methods or adding extra ones.
Each tablecanvas has a model associated with it, this class handles all the data, updating, sorting and so on. Again, the base class is called TableModel and you sub-class this for specific uses.
Example:
To create a basic table, only the following 4 lines are needed. We can also create a model from some data, then use that model to initiate the table. The data, a dictionary, will be appropriate to that model of course.

tframe = Frame(master)
tframe.pack()
table = TableCanvas(tframe)
table.createTableFrame()