ex_ncurses v0.3.1 ExNcurses.Getstr

Link to this section Summary

Functions

Initialize state for string entry

Process a key press

Link to this section Functions

Link to this function init(y, x, length)
init(non_neg_integer(), non_neg_integer(), pos_integer()) :: %ExNcurses.Getstr{
  chars: term(),
  cursor: term(),
  field_length: term(),
  x: term(),
  y: term()
}

Initialize state for string entry

Link to this function process(state, key)
process(
  %ExNcurses.Getstr{
    chars: term(),
    cursor: term(),
    field_length: term(),
    x: term(),
    y: term()
  },
  non_neg_integer()
) ::
  {:done, String.t()}
  | :cancelled
  | {:not_done,
     %ExNcurses.Getstr{
       chars: term(),
       cursor: term(),
       field_length: term(),
       x: term(),
       y: term()
     }}

Process a key press

Returns:

  • {:done, string} when the user presses enter
  • :cancelled if the user presses ESCape
  • {:not_done, state} if more is coming