Column not updating in listbox in wxPython example ??

D

David Poundall

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.SetTopWindow (frame)
return true

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

self.lc = wxListCtrl(self,15,wxDLG_PNT(self,10,60),
wxDLG_SZE(self,120,75), style=wxLC_REPORT)
EVT_LIST_ITEM_SELECTED(self,15,self.getSelect)
self.lc.InsertColumn(0,"Name")
self.lc.InsertColumn(1,"Phone")
name = 'Peter'
phone = '01753 865830'
row = 1
self.lc.InsertStringItem(row, name)
self.lc.SetStringItem(row, 1, phone)

def getSelect (self, event) :
self.currentSel = event.m_itemIndex

app = MyApp(0)
app.MainLoop()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top