code: def OnTableChanged(self, event):
          
  
          if hasattr(event, 'table'):
              self.SetValue(event.table)
  
          wx.TextCtrl.SetInsertionPoint(self, self.cursor_pos)
  
          event.Skip()
docs: Table changed event handler