import wx class ListFrame(wx.Frame): def __init__(self, *args, **kwds): kwds['style'] = kwds.get('style', 0) | wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.SetSize((400, 300)) self.SetTitle('Lista kontroll teszt') self.listctrl1 = wx.ListCtrl(self, wx.ID_ANY, style=wx.LC_REPORT) self.listctrl1.InsertColumn(0, 'Név', wx.LIST_FORMAT_CENTER, 100) self.listctrl1.InsertColumn(1, 'Ár', wx.LIST_FORMAT_CENTER, 100) self.listctrl1.InsertStringItem(0, 'alma') self.listctrl1.SetStringItem(0, 1, '850') self.listctrl1.InsertStringItem(1, 'körte') self.listctrl1.SetStringItem(1, 1, '785') self.listctrl1.InsertItem(2, 'barack') self.listctrl1.SetStringItem(2, 1, '984') class ListApp(wx.App): def OnInit(self): self.frame = ListFrame(None, wx.ID_ANY, "") self.SetTopWindow(self.frame) self.frame.Show() return True if __name__ == "__main__": app = ListApp(0) app.MainLoop()