we can instantiate textbox object as follows:
class curses.textpad.Textbox(win):
It returns a textbox widget object. The win argument here should be a curses window object in which the textbox is to be contained. The edit cursor of the textbox is initially located at the upper left hand corner of the containing window, with coordinates as (0, 0). The instance%u2019s stripspaces flag is initially on.
Textbox object have the following methods:
1)edit([validator]):
This is an entry point we will normally use. It accepts editing keystrokes until one of the termination keystrokes is entered. If validator is supplied, it must be a function. It will be called for each keystroke entered with the keystroke as a parameter; command dispatch is done on the result. This function returns the window contents as a string; whether blanks in the window are included is affected by the stripspaces attribute.
2)gather():
It returns the window contents as a string; whether blanks in the window are included is affected by the stripspaces member.
Comments