An ObjectListView is a wrapper around the wx.ListCtrl that makes the list control easier to use. It also provides some useful extra functionality.
Larry Wall, the author of Perl, once wrote that the three essential character flaws of any good programmer were sloth, impatience and hubris. Good programmers want to do the minimum amount of work (sloth). They want their programs to run quickly (impatience). They take inordinate pride in what they have written (hubris).
ObjectListView encourages the vices of sloth and hubris, by allowing programmers to do far less work but still produce great looking results.
Without wasting my time, just tell me what it does!¶
OK, here’s the bullet point feature list:
- Automatically transforms a collection of model objects into a fully functional wx.ListCtrl.
- Automatically sorts rows.
- Easily edit the cell values.
- Supports all ListCtrl views (report, list, large and small icons).
- Columns can be fixed-width, have a minimum and/or maximum width, or be space-filling (Column Widths)
- Displays a “list is empty” message when the list is empty (obviously).
- Supports checkboxes in any column
- Supports alternate rows background colors.
- Supports custom formatting of rows.
- Supports searching (by typing) on any column, even on massive lists.
- Supports custom sorting
- Supports Filtering and batched updates
- The FastObjectListView version can build a list of 10,000 objects in less than 0.1 seconds.
- The VirtualObjectListView version supports millions of rows through ListCtrl’s virtual mode.
- The GroupListView version supports arranging rows into collapsible groups.
- Effortlessly produce professional-looking reports using a ListCtrlPrinter.
Seriously, after using an ObjectListView, you will never go back to using a plain wx.ListCtrl.
OK, I’m interested. What do I do next?¶
You can install it using pip:
pip install objectlistview
or you can download a source package from BitBucket, select one of the version tags or tip for the current development version, if you are not a developer it is recommended that you download the most recent version. To install it to your installed Python version run setup.py install from the base folder.
At some point, you will want to do something with an ObjectListView and it won’t be immediately obvious how to make it happen. After dutifully scouring the Getting Started and the Cookbook sections, you decide that is is still not obvious.
It may even be possible that you might find some undocumented features in the code (also known as bugs). These “features” can be reported and tracked on the project’s Issue Tracker.
Please do not use the old address on SourceForge which you might come across on Google or other sources.
If you have a question you might ask on StackExchange with a tag of ‘objectlistview’ or on the wxPython-users list.
If you are a very keen developer, you can access the Bitbucket repository directly for this project. The following hg command will fetch the most recent version from the repository.
hg clone ssh://email@example.com/wbruhin/objectlistview
hg clone https://firstname.lastname@example.org/wbruhin/objectlistview
The 101 about Bitbucket can be found here.
Please remember that code within Bitbucket is bleeding edge. It has not been well-tested and is almost certainly full of bugs. If you just want to play with the ObjectListView, it’s better to stay with the official releases, where the bugs are (hopefully) less obvious.