code: def OnTextSize(self, event):
          
  
          try:
              size = int(event.GetString())
  
          except Exception:
              size = get_default_font().GetPointSize()
  
          post_command_event(self, self.FontSizeMsg, size=size)
docs: Text size combo text event handler