Column not updating in listbox in wxPython example ??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Poundall

    #1

    Column not updating in listbox in wxPython example ??

    In the following example the phone number does not apear in the phone
    column of the llistbox. Can anybody tell me what I am doing wrong here
    ?

    from wxPython.wx import *

    class MyApp (wxApp) :
    def OnInit (self) :
    frame = MyFrame(NULL, -1, "Phone List")
    frame.Show(true )
    self.SetTopWind ow (frame)
    return true

    class MyFrame (wxFrame) :
    def __init__ (self, parent, ID, title) :

    self.lc = wxListCtrl(self ,15,wxDLG_PNT(s elf,10,60),
    wxDLG_SZE(self, 120,75), style=wxLC_REPO RT)
    EVT_LIST_ITEM_S ELECTED(self,15 ,self.getSelect )
    self.lc.InsertC olumn(0,"Name")
    self.lc.InsertC olumn(1,"Phone" )
    name = 'Peter'
    phone = '01753 865830'
    row = 1
    self.lc.InsertS tringItem(row, name)
    self.lc.SetStri ngItem(row, 1, phone)

    def getSelect (self, event) :
    self.currentSel = event.m_itemInd ex

    app = MyApp(0)
    app.MainLoop()

Working...