def T(s):
print(s.text, s.number)
winput( bind=T )
The winput object (widget input) displays a box in which the user can input a numeric expression or text. The user must select the text either by clicking in the box or by using the tab key.
bind The name of the function to be called when the user presses Enter.
type "numeric" (the default) or "string". If it is numeric, the user can input expressions such as 3+2*sqrt(5.2e4). An error message is displayed if there is something wrong with the expression, and the bound function is not called.
width The width of the winput box in pixels; default is 100.
height The height of the winput box in pixels; default is 20.
text The text displayed in the box, whether entered by the user or set by the program (for example, one might wish to set the text to be displayed before the user enters anything, which the user can modify).
number The number that results from evaluating the user's input text if the type is "numeric" (otherwise it is None). If a numeric winput object is named W and the user enters 3+5, then W.text will be the string "3+5" and W.number will be 8.
disabled If True, the text is grayed out and the winput is inactive.
delete() If W is a winput, W.delete() deletes the winput box from the display.
Bruce