Module: lib-widget.inputfield

Create a new inputfield widget

Useful when you want to separate widgets from each other

-- basic inputfield
local inputfield = lib-widget.inputfield()

hidden inputfield

Class Hierarchy

  • lib-widget.inputfield

Info:

  • Copyright: 2020 Tom Meyers
  • Author: Tom Meyers

Static module functions

lib-widget.inputfield.inputfield ([typing_callback[, done_callback[, hidden]]]) -> widget Create a new inputfield widget
lib-widget.inputfield.get_text () Get the current text that is in the inputfield
lib-widget.inputfield.update_text (text) Change the text in the input field, useful when you want to validate input
lib-widget.inputfield.clear_text () Clear the text from the inputfield, but keep the focus
lib-widget.inputfield.stop_grabbing () Stop listening for keystrokes, but keep the text in the input field
lib-widget.inputfield.reset () Reset the inputfield, this means stop listening and reset the text


Static module functions

lib-widget.inputfield.inputfield ([typing_callback[, done_callback[, hidden]]]) -> widget
Create a new inputfield widget

Parameters:

  • typing_callback function This callback gets triggered on every keystroke (optional)
  • done_callback function This callback gets triggered when the user finished typing (optional)
  • hidden bool This option tells us if we need to mask the input (with * instead of the real text) (optional)

Returns:

    widget The inputfield widget

Usage:

    -- This will create a basic inputfield
     local inputfield = lib-widget.inputfield()
lib-widget.inputfield.get_text ()
Get the current text that is in the inputfield

Usage:

    -- Get the active text in the input field
     local text = inputfield.get_text()
lib-widget.inputfield.update_text (text)
Change the text in the input field, useful when you want to validate input

Parameters:

  • text string the text to supply

Usage:

    -- Update the text in the inputfield
     inputfield.update_text("This is some new text")
lib-widget.inputfield.clear_text ()
Clear the text from the inputfield, but keep the focus

Usage:

    -- Clear the text from the inputfield
     inputfield.clear_text()
lib-widget.inputfield.stop_grabbing ()
Stop listening for keystrokes, but keep the text in the input field

Usage:

    -- Stop listening for keystrokes
     inputfield.stop_grabbing()
lib-widget.inputfield.reset ()
Reset the inputfield, this means stop listening and reset the text

Usage:

    -- Resets the inputfield
     inputfield.reset()
generated by LDoc 1.4.6 Build with 💜 By F0xedb Last updated 2021-05-21 03:30:15