def askLogin(defaultUser='', defaultPassword='', mayCancel=True):
    """Return None if user cancels; otherwise (user, password) as unicode."""
    result = useTemporaryDialog('dialog.xrc', 'dlgLogin', mayCancel,
                                'fldUser', 'fldPassword',
                                fldUser=defaultUser,
                                fldPassword=defaultPassword)
    return result
Return None if user cancels; otherwise (user, password) as unicode.
recipes/Python/496868_Easily_creating_dialog_boxes_XRC/recipe-496868.py