|
If you check back the archives you will see I have
reported quite a few issues with large datasets and treeviews. I have
been promising a pygtk wrapper around the treeview that provides better
performance + I am nearly there. I've attached my code, there is
quite a bit more I intend to do to it, but given your message I thought
it worth posting now. I think with a little work you could get good performance for your particular problem using this approach. From the docstring at the top of the code: An easy to use PyGTK grid that performs well with very large datasets. Supports sorting and filtering of data. The gtk treeview is a very powerful widget, but has serious performance issues as the number of rows in the store grows. Sorted and Filtered stores can cause significant bottlenecks. For very large datasets, just loading the data into the store can be a problem. In some cases you might have very large tables that a user might want to browse. For instance, you might be using PyTables: http://pytables.sourceforge.net/html/WelcomePage.html Whilst you can create your own custom store to avoid having to read the data into memory, as soon as you attach this store to a view the view sets up a gtkrbtree for as many elements as your store says it has :( EasyGrid works around this by using a small ListStore as a buffer between the view and your actual data. The View is embedded in a ScrolledWindow, with the vertical scrollbar hidden. A separate vertical scrollbar is used to show the actual position in your data. There is lots of hacking to intercept various events and make the whole thing just about work. TODO: 1. Tidy things up, remove debugging debris 2. Get the sorting working, support reverse. 3. Get filtering working nicely. 4. Get the API for data objects worked out so users don't have to provide any more sorting or filtering code than absolutely necessary. 5. Make auto_setup much smarter, allow it to be fed formatting hints. 6. Support a data object where the data is a list of dictionaries. 7. Have an automatic option for the vertical scrollbar. 8. Anything else I can think of. I hope to get some of this fixed up in the not too distant future. John Jon Ellis wrote:
|
easygrid.py
Description: application/python
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
