def popup_inputbox(title, text, par_widget):
 h2 = 1
 w2 = ((par_widget.width * 6) // 7)
 x = ((((par_widget.width - w2) // 2) - 1) + par_widget.x)
 y = ((((par_widget.height - h2) // 2) - 1) + par_widget.y)
 borders = curses.newwin((h2 + 2), (w2 + 2), y, x)
 borders.border()
 borders.addstr(0, ((w2 - len(title)) // 2), (' %s ' % title))
 borders.refresh()
 return inputbox(text, (x + 1), (y + 1), w2, h2)

def popup_inputbox ( title , text , par_widget ) : h2 = 1 w2 = ( ( par_widget . width * 6 ) // 7 ) x = ( ( ( ( par_widget . width - w2 ) // 2 ) - 1 ) + par_widget . x ) y = ( ( ( ( par_widget . height - h2 ) // 2 ) - 1 ) + par_widget . y ) borders = curses . newwin ( ( h2 + 2 ) , ( w2 + 2 ) , y , x ) borders . border ( ) borders . addstr ( 0 , ( ( w2 - len ( title ) ) // 2 ) , ( ' %s ' % title ) ) borders . refresh ( ) return inputbox ( text , ( x + 1 ) , ( y + 1 ) , w2 , h2 )
it opens a centered popup and returns the text entered by the user .