code: def OnChar(self, event):
          
  
          key = event.GetKeyCode()
  
          if key < wx.WXK_SPACE or key == wx.WXK_DELETE or key > 255 or \
             chr(key) in string.digits:
              event.Skip()
docs: Eats event if key not in digits