LineEdit (hwx.gui)#

class LineEdit(text='', validator=None, **kwds)#

Bases: Widget

A LineEdit Widget that can display/edit a string.

A line edit allows the user to enter and edit a single line of plain text with a useful collection of editing functions, including undo and redo, cut and paste, and drag and drop.

Attribute Table#

Name

Type

alignment

property

readonly

property

text

property

Method Table#

Name

Description

validate (self, widget)

Validates the value of the widget.

Example

from hwx import gui

# This method is called whenever the text in the LineEdit is changed.
def command(event):
output.text = input.value

# Create an input LineEdit and an output Label so we can see the result
# of changing the text.
input = gui.LineEdit('Type Here', command=command)
output = gui.Label(input.value)

# Layout the input and output as in a horizontal grid

frame = gui.HFrame(input, 10, output)

show(frame)
property alignment#

Alignment of text (left, center or, right).

property readonly#

Returns and sets whether text/value can be edited.

validate(widget)#

Validates the value of the widget.

property text: uiString#

Alias for value property.