parameters: (self, prompt, initval=None)
docstring: Pop up a window to accept a string.
docstring_summary: Pop up a window to accept a string.
docstring_tokens: Pop up a window to accept a string .
function: def query_popup(self, prompt, initval=None):
          "Pop up a window to accept a string."
          maxsymwidth = self.columns - len(prompt) - 10
          if initval and len(initval) > maxsymwidth:
              self.help_popup("PRESSANY", (lang["TOOLONG"],), beep=1) 
              return initval
          gwinwidth = (len(prompt) + maxsymwidth)
          start_y = self.lines/2-3
          start_x = (self.columns - gwinwidth)/2
          subwin = self.window.subwin(3, 2+gwinwidth, start_y-1, start_x-1)
          subwin.clear()
          subwin.box()
          self.window.addstr(start_y, start_x, prompt, curses.A_BOLD)
          self.window.refresh()
          subwin.refresh()
          subsubwin = subwin.subwin(1,maxsymwidth,start_y,start_x+len(prompt))
          if initval:
              subsubwin.addstr(0, 0, initval[:maxsymwidth-1])
              subsubwin.touchwin()
          configuration.debug_emit(1, "+++ %s"% (prompt,))
          textbox = curses.textpad.Textbox(subsubwin)
          popupval = textbox.edit()
          self.window.touchwin()
          if initval and textbox.lastcmd == curses.ascii.BEL:
              return initval
          else:
              return popupval
function_tokens: def query_popup ( self , prompt , initval = None ) : maxsymwidth = self . columns - len ( prompt ) - 10 if initval and len ( initval ) > maxsymwidth : self . help_popup ( "PRESSANY" , ( lang [ "TOOLONG" ] , ) , beep = 1 ) return initval gwinwidth = ( len ( prompt ) + maxsymwidth ) start_y = self . lines / 2 - 3 start_x = ( self . columns - gwinwidth ) / 2 subwin = self . window . subwin ( 3 , 2 + gwinwidth , start_y - 1 , start_x - 1 ) subwin . clear ( ) subwin . box ( ) self . window . addstr ( start_y , start_x , prompt , curses . A_BOLD ) self . window . refresh ( ) subwin . refresh ( ) subsubwin = subwin . subwin ( 1 , maxsymwidth , start_y , start_x + len ( prompt ) ) if initval : subsubwin . addstr ( 0 , 0 , initval [ : maxsymwidth - 1 ] ) subsubwin . touchwin ( ) configuration . debug_emit ( 1 , "+++ %s" % ( prompt , ) ) textbox = curses . textpad . Textbox ( subsubwin ) popupval = textbox . edit ( ) self . window . touchwin ( ) if initval and textbox . lastcmd == curses . ascii . BEL : return initval else : return popupval