qlineedit - one line text editor
Name
qlineedit — one line text editor
Syntax
qlineedit [ cmds ...]
Description
The qlineedit command creates a QLineEdit object. This is a one-line entry-field for text where the user may interactively edit the contents. An optional callback string may be assigned that will be called whenever the text is changed interactively by the user. The text itself is appended to the callback string before evaluation. It is the responsibility of the programmer to ensure that the resulting string is a valid Tcl command.
The contents of the text field may be set using the qsettext command. Use qclear to clear the field. To retrieve the text use qtext.
Arguments
cmds
One or more commands to be performed when the text changes. The text contained in the QLineEdit is appended before evaluation. The commands must be a string or a list which adheres to Tcl's syntax. For such, a string may be either a single word or several words grouped as one string using quotes. A list is delimited by the '{' and '}' characters.
Examples
Ex.1: QLineEdit
# Callback for lineedit proc do_something { text } { } set w [qwidget ] qsetwindowtitle QLineEdit qvboxlayout { qlineedit qsettext Hello # Calls 'do_something' whenever a change takes place # The text as appended to the callback expression qlineedit do_something } qshow $w
Example QLineEdit shows two QLineEdits, one of which is assigned a callback string. Whenever the text in the textfield is edited, the entire text will be appended to the callback expression, thus forming a valid call to the procedure 'do_something'.