def addPerson(self, event): name = self.pName.GetValue() gen = self.pGen.GetValue() age = self.pAge.GetValue() occ = self.pOcc.GetValue() if (name == '') or (gen == '') or ( age == '') or ( occ == ''): dialog = wx.MessageDialog( None, ' One or more fields are missing. Enter a value in each text box. ', 'Missing Details' , wx.OK|wx.CANCEL) dialog.ShowModal() dialog.Destroy() return False print name print gen print age print occ Database.newPerson(name,gen,age,occ) print Database.checkPerson() self.pName.Clear() self.pAge.SetValue(0) self.pGen.Clear() self.pOcc.Clear() self.fillListCtrl()
def fillListCtrl(self): data = Database.checkPerson() self.listCtrl.DeleteAllItems() for row in data: self.listCtrl.Append(row)