As promised earlier I've put out my latest easygrid code.

You can find it here:

http://www.earthenware-services.org/software/EarthenwareLibrary/

Anyone working with pytables might find pigtables.py of interest -- this is a quick and dirty hack using easygrid to view HDF5 files from pytables.

This is makes a good demo of how easygrid can handle really large grids of data -- pytables allows you to access records off disk only when the user actually wants to see them + easygrid allows you to avoid loading all those records into a ListStore in order to view them in a treeview.

Lots more work to do on this, but there is enough there now to see where it is heading.

Here is a quick example of how to use the thing.  The aim is that if you have a simple python list of lists that you want to throw into a grid and have the user be able to sort (click on column header) or filter (middle click on cell value you want to see) you should be able to do that in a few lines of python.

import gtk
import math
from random import randint
import earthenware.gui.pgtk.easygrid as eg

data = ""> for x in xrange(1000):
    xx = randint(0, 100)
    yy = randint(0, 100)
    data.append([xx, math.sqrt(xx), yy, math.sqrt(yy*xx)])

w = gtk.Window()
view = eg.EasyGrid()
w.add(view)
colnames = ['x', 'sqrt(x)', 'y', 'sqrt(x*y)']
view.auto_setup(eg.SortableFilterableData(data), colnames)

w.show_all()

gtk.main()


_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to