import wx
class Monitor(wx.Frame):
def __init__(self,parent,title):
wx.Frame.__init__(self, parent, title=title)
self.count = 0
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.outputListCtrl = wx.ListCtrl(self,style=wx.LC_REPORT|wx.BORDER_SUNKEN)
self.outputListCtrl.InsertColumn(0,'Time')
self.sizer.Add(self.outputListCtrl,1,wx.EXPAND|wx.ALL)
self.SetSizer(self.sizer)
self.SetAutoLayout(1)
self.sizer.Fit(self)
self.Show()
self.update()
def update(self):
print self.count
wx.CallLater(1000, self.update)
print self.count
self.outputListCtrl.DeleteAllItems()
self.outputListCtrl.InsertStringItem(0,'{}'.format(self.count))
self.count = self.count + 1
if __name__ == '__main__':
app = wx.App(False)
#app.SetAssertMode(wx.PYAPP_ASSERT_SUPPRESS)
frame = Monitor(None,'Monitor')
app.MainLoop()