import wx

class MyPanel(wx.Panel):
    def __init__(self, parent):
        super().__init__(parent)

        # Define some rows of data
        row1 = [355, 'Client', 'Zingall']
        row2 = [1, 'ShipTo', 'Smith']
        row3 = [55536, 'B2B', 'Summer Supplies']

        # create a listctrl
        self.list = wx.ListCtrl(self, -1,
                                style = wx.LC_REPORT
                                | wx.LC_HRULES
                                | wx.LC_VRULES
                                | wx.LC_SINGLE_SEL)

        self.list.AppendColumn('ID')
        self.list.AppendColumn('Type')
        self.list.AppendColumn('LastName')

        # attribute = (textcolor, backgroundcolor, font)
        listfont = self.list.GetFont()
        headfont = listfont.MakeBold()
        headAttr = wx.ItemAttr((0,0,0), (240,240,240), headfont)
        self.list.SetHeaderAttr(headAttr)

        self.list.Append(row1)
        self.list.Append(row2)
        self.list.Append(row3)

        layout = wx.BoxSizer(wx.VERTICAL)
        layout.Add(self.list, 1, wx.EXPAND)
        self.SetSizer(layout)
        self.Layout()

class MyFrame(wx.Frame):
    def __init__(self, parent, title=""):
        super().__init__(parent, title=title)
        self.SetSize((640, 480))

        # Set the panel
        self.panel = MyPanel(self)

class MyApp(wx.App):
    def OnInit(self):

        self.frame = MyFrame(None, title='ListCtrl Testing')
        self.frame.Show();
        return True

if __name__ == "__main__":
    app = MyApp(False)
    app.MainLoop()
