O'Reilly logo

WxPython Application Development Cookbook by Cody Precord

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying lists of data

If your application needs to generally display small amount of tabular data, the standard ListCtrl component can be a quick and easy way to present this data to users. ListCtrl can operate in a number of visual modes that present data in a different way to the user. The report mode is the mode that we are going to take a look at in this recipe as it allows us to build a multicolumn table to display the data in.

How to do it…

Here are the steps that you need to perform:

  1. First, let's make a custom ListCtrl base class to add some useful helper functions to, as follows:
    class BaseList(wx.ListCtrl): def __init__(self, parent): super(BaseList, self).__init__(parent, style=wx.LC_REPORT) self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnRClick) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required