Rework check_input so that it can work with any widget that gives a string.