Class widget:entry

Single-line text entry widget
This module is only available from the UI process Lua state.

The entry widget shows a text box for single-line user input.

Methods

entry:insert (position, text)

Insert text into the entry widget.

Parameters

  • position
    Type: integer
    Optional
    Optional position at which to insert text. Defaults to inserting at the end of any text already in the entry widget.
  • text
    Type: string
    The text to insert.

entry:select_region (startpos, startpos)

Select some or all of the text within the entry widget.

Parameters

  • startpos
    Type: integer
    The start of the region.
  • startpos
    Type: integer
    Optional
    The end of the region. Defaults to the end of the text in the entry widget.

Properties

entry.position

Type: integer
Read-write
The position of the caret within the entry widget.

entry.text

Type: string
Read-write
The contents of the entry widget.

entry.fg

Type: string
Read-write
The color of the text within the entry widget.

entry.bg

Type: string
Read-write
The background color of the entry widget.

entry.font

Type: string
Read-write
The font to use to display the text within the entry widget.

entry.show_frame

Type: boolean
Read-write
Whether the frame surrounding the entry widget should be shown.

Signals

"activate"

Emitted when the entry widget is activated by pressing the Enter key.

"changed"

Emitted when the text within the entry widget changes.

"property::position"

Emitted when the position of the caret within the entry widget changes.

"key-press"

Emitted when a key is pressed while the entry widget has the input focus.

Parameters

  • modifiers
    Type: table
    An array of strings, one for each modifier key held.
  • key
    Type: string
    The key that was pressed, if printable, or a keysym otherwise.

Return Values

  • boolean
    true if the event has been handled and should not be propagated further.

Attribution

Copyright