title: npyscreen and threading : change form in an other thread
body: <p>So here we go. I am working on a funny project that purpose a login interface (standard username/password input) :</p>
  
  <pre><code>class LoginDisplay(npyscreen.Form):
  
      def create(self):
          self.name = Config.welcome_message
          self.wgUsername = self.add(npyscreen.TitleText, name="Username :")
          self.wgPassword = self.add(TitlePassword, name="Password :")
  
      def beforeEditing(self):
          self.parentApp.unlog_user()
          self.wgUsername.value = ""
          self.wgPassword.value = ""
  
      def afterEditing(self):
          self.parentApp.log_user(self.wgUsername.value, self.wgPassword.value)
  </code></pre>
  
  <p>Sounds cool, work fine.</p>
  
  <p>My issue is that I am working on an other way to login using an NFC reader. The code is kind of simple :</p>
  
  <pre><code>def badge(myApp):
      """ Target function of a Thread """
      device = serial.Serial('/dev/ttyUSB0',timeout=60)
      device.setTimeout(1)
      buff = ''
      while myApp.isAlive: 
          s = device.read(1)
          if s == '':
              sleep(1)
          elif s == '\r' :
              # buff var containing the badge id
              myApp.login_by_badge(buff)
          else:
              buff = buff + s
  </code></pre>
  
  <p>So the objective is, if the login is correct, to change the current form (the current form) like this :</p>
  
  <pre><code>class MyApplication(npyscreen.NPSAppManaged):
  
       # .../...
  
       def log_user(self, username, password):
           if self._valid_login(username, password):
               self.switchForm("ANOTHER_FORM")
  
       def login_by_badge(self, badge_id):
           if self._valid_badge(badge_id):
               self.switchForm("ANOTHER_FORM")
  </code></pre>
  
  <p>Of course, switching forms in the sub-thread does. I look deep in the sources, and it looks like the library <code>npyscreen</code> is absolutely not designed for this kind of things.</p>
  
  <p><strong>Question</strong>: Should I implement my owns windgets, forms and parts of my application to manage this, or is there a common way to deal with threads interactions in <code>npyscreen</code> ?</p>