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()
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()