Library

Library

Documentation for TextUserInterfaces.jl.

Dictionary defining values of the field justification.

Dictionary defining values of the field options.

Dictionary defining values of the form commands.

Dictionary defining values of the menu commands.

struct Keystorke

Structure that defines a keystroke.

Fields

  • value: String representing the keystroke.
  • ktype: Type of the key (:char, :F1, :up, etc.).
  • alt: true if ALT key was pressed (only valid if ktype != :char).
  • ctrl: true if CTRL key was pressed (only valid if ktype != :char).
  • shift: true if SHIFT key was pressed (only valid if ktype != :char).
source
struct WINDOW

Handles a ncurses window.

function ACS_(s::Symbol)

Return the symbol s of the acs_map. For example, ACS_HLINE can be obtained from ACS_(:HLINE).

function COLS()

Return the number of columns in the root window. It must be called after initscr().

For more information, consult libncurses documentation.

function LINES()

Return the number of lines in the root window. It must be called after initscr().

For more information, consult libncurses documentation.

function TYPE_ALNUM()

Return a pointer to the global symbol TYPE_ALNUM of libform.

function TYPE_ALPHA()

Return a pointer to the global symbol TYPE_ALPHA of libform.

function TYPE_ENUM()

Return a pointer to the global symbol TYPE_ENUM of libform.

function TYPE_INTEGER()

Return a pointer to the global symbol TYPE_INTEGER of libform.

function TYPE_IPV4()

Return a pointer to the global symbol TYPE_IPV4 of libform.

function TYPE_IPV6()

Return a pointer to the global symbol TYPE_IPV6 of libform.

function TYPE_NUMERIC()

Return a pointer to the global symbol TYPE_NUMERIC of libform.

function TYPE_REGEXP()

Return a pointer to the global symbol TYPE_REGEXP of libform.

function accept_focus(widget)

Return true is the widget widget accepts focus or false otherwise.

function accept_focus(form::TUI_FORM)

Command executed when form form must state whether or not it accepts the focus. If the focus is accepted, then this function returns true. Otherwise, it returns false.

function accept_focus(menu::TUI_MENU)

Command executed when menu menu must state whether or not it accepts the focus. If the focus is accepted, then this function returns true. Otherwise, it returns false.

function accept_focus(window::Window)

Check if the window window can accept focus and, if it can, then perform the actions to change the focus.

function attroff(attrs::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function attron(attrs::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function bottom_panel(pan::Ptr{Cvoid})

Return type: Int32

For more information, consult libmenu documentation.

function box(win::Ptr{WINDOW}, verch::jlchtype, horch::jlchtype)

Return type: Nothing

For more information, consult libncurses documentation.

function cbreak()

Return type: Nothing

For more information, consult libncurses documentation.

function change_text(widget::WidgetLabel, new_text::AbstractString; alignment = :l, color::Int = -1)

Change to text of the label widget widget to new_text.

The text alignment in the widget can be selected by the keyword alignment, which can be:

  • :l: left alignment (default);
  • :c: Center alignment; or
  • :r: Right alignment.

The text color can be selected by the keyword color. It it is negative (default), then the current color will not be changed.

function change_value(widget::WidgetProgressBar, new_value::Integer; color::Int = -1)

Change the value of the progress bar to new_value.

The color can be selected by the keyword color. It it is negative (default), then the current color will not be changed.

function clear()

Return type: Int32

For more information, consult libncurses documentation.

function clrtobot()

Return type: Int32

For more information, consult libncurses documentation.

function clrtoeol()

Return type: Int32

For more information, consult libncurses documentation.

function copywin(scr::Ptr{WINDOW}, dest::Ptr{WINDOW}, sminrow::Integer, smincol::Integer, dminrow::Integer, dmincol::Integer, dmaxrow::Integer, dmaxcol::Integer, overlay::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function create_field(height::Int, width::Int, y::Int, x::Int, buffer::String = "", id::String = "", offscreen::Int = 0, nbuffers::Int = 0; ...)

Create a field with id id, height height and width width, positioned at y and x coordinates. The initial buffer string can be set by the variable buffer. The number of off-screen rows is set by offscreen and the number of buffers nbuffers.

Keywords

  • color_foreground: Color mask that will be used in the field foreground. See function ncurses_color. If negative, then the color will not be changed. (Default = -1)
  • color_background: Color mask that will be used in the field background. See function ncurses_color. If negative, then the color will not be changed. (Default = -1)
  • justification: Justification of the form. It can be :l for left, :c for center, and :r for right. For any other symbol, the left justification is used. (Default = :l)
  • visible: If true, then the control is visible on the screen. (Default = true)
  • active: If true, then the control is active. (Default = true)
  • public: If true, then the data of the field is displayed during entry. For example, set this to false for password fields. (Default = true)
  • edit: If true, then the data of the field can be modified. (Default = true)
  • wrap: If true, then the word will be wrapped in multi-line fields. (Default = true)
  • blank: If true, then entering a character at the first field position erases the entire fields. (Default = false)
  • autoskip: If true, then the field will be automatically skipped when filled. (Default = false)
  • nullok: If true, then the validation is not applied to blank fields. (Default = true)
  • passok: If true, then the validation will occur on every exit. Otherwise, it will only occur when the field is modified. (Default = false)
  • static: If true, then the field is fixed to the initial dimensions. Otherwise, it will stretch to fit the entered data. (Default = true)
function create_form(fields::Vector{TUI_FIELD}; ...)

Create a new form with the fields fields.

Keywords

  • newline_overload: Enable overloading of REQ_NEW_LINE. (Default = false)
  • backspace_overload: Enable overloading of REQ_DEL_PREV. (Default = false)

function create_menu(names::Vector{T1}, descriptions::Union{Nothing,Vector{T2}} = nothing; kwargs...)

Create a menu with the names names and descriptions descriptions. If descriptions is nothing or is omitted, then the menu descriptions will not be shown.

Keywords

  • format: If nothing, then the default menu format will be used. Otherwise, it must be a tuple with two integers describing respectively the number of rows and columns. (Default = nothing)
  • mark: The menu mark. (Default = -)
  • one_value: If true, then the menu cannot have multiple selections. (Default = true)
  • show_desc: If true, then the menu description will be shown. (Default = true)
  • row_major: If true, then the menu will be constructed in a row-major ordering.
  • ignore_case: If true, then the case will be ignored on pattern matching.
  • show_match: If true, then the cursor will be moved to within the item name while pattern-matching.
  • non_cyclic: If true, then the menu will be non cyclic.
function create_widget(T, parent::Window, begin_y::Integer, begin_x::Integer, vargs...; kwargs...)

Create the widget of type T in the parent window parent. The widget will be positioned on the coordinate (begin_y, begin_x) of the parent window.

Additional variables and keywords related to each widget can be passed using vargs and kwargs respectively.

function create_window(nlines::Integer, ncols::Integer, begin_y::Integer, begin_x::Integer, id::String = ""; bcols::Integer = 0, blines::Integer = 0, border::Bool = true, border_color::Int = -1, title::String = "", title_color::Int = -1)

Create a window. The new window size will be nlines × ncols and the origin will be placed at (begin_y, begin_x) coordinate of the root window. The window ID id is used to identify the new window in the global window list.

Keyword

  • bcols: Number of columns in the window buffer. This will be automatically increased to, at least, fit the viewable part of the window (ncols). (Default = 0)
  • blines: Number of lines in the window buffer. This will be automatically increased to, at least, fit the viewable part of the window (nlines). (Default = 0)
  • border: If true, then the window will have a border. (Default = true)
  • border_color: Color mask that will be used to print the border. See function ncurses_color. If negative, then the color will not be changed. (Default = -1)
  • focusable: If true, then the window can have focus. Otherwise, all focus request will be rejected. (Default = true)
  • title: The title of the window, which will only be printed if border is true. (Default = "")
  • title_color: Color mask that will be used to print the title. See function ncurses_color. If negative, then the color will not be changed. (Default = -1)
function current_item(menu::Ptr{Cvoid})

Return type: Ptr{Nothing}

For more information, consult libmenu documentation.

current_item(menu::TUI_MENU) = current_item(menu.ptr)

Return the current item of the menu menu.

function current_item_desc(menu::TUI_MENU)

Return the item description of the menu menu.

function current_item_name(menu::TUI_MENU)

Return the item name of the menu menu.

function curs_set(visibility::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function curses_version()

Return the NCurses version in a named tuple with the following fields:

  • major: Major version.
  • minor: Minor version.
  • patch: Patch version.
function del_panel(panel::Ptr{Cvoid})

Return type: Ptr{Nothing}

For more information, consult libmenu documentation.

function delwin(win::Ptr{WINDOW})

Return type: Nothing

For more information, consult libncurses documentation.

function derwin(win::Ptr{WINDOW}, nlines::Integer, ncols::Integer, begin_y::Integer, begin_x::Integer)

Return type: Ptr{WINDOW}

For more information, consult libncurses documentation.

function destroy_all_windows()

Destroy all windows managed by the TUI.

function destroy_field(field::Ptr{Cvoid})

Destroy the field field.

function destroy_form(form::TUI_FORM)

Destroy the form form.

function destroy_menu(menu::TUI_MENU)

Destroy the menu menu.

function destroy_tui()

Destroy the Text User Interface (TUI).

function destroy_widget(widget; refresh::Bool = true)

Destroy the widget widget.

If refresh is true (default), then a full refresh will be performed on the parent window. Otherwise, no refresh will be performed.

function destroy_window(win::Window)

Destroy the window win.

function doupdate()

Return type: Nothing

For more information, consult libncurses documentation.

function endwin()

Return type: Nothing

For more information, consult libncurses documentation.

function erase()

Return type: Int32

For more information, consult libncurses documentation.

function field_buffer(field::Ptr{Cvoid}, buffer::Integer)

Return type: Cstring

For more information, consult libform documentation.

function focus_on_widget(widget::Widget)

Move focus to the widget widget.

function focus_on_widget(window::Window, id::Integer)

Move focus to the widget ID id on window window.

function form_add_char(form::TUI_FORM, ch::Int)

Add the character ch to the active field of the form form.

function form_beg_field(form::TUI_FORM)

Move to the beginning of the active field in the form form.

function form_del_char(form::TUI_FORM)

Delete the character at the cursor of the active field in the form form.

function form_del_prev(form::TUI_FORM)

Delete the previous character from the cursor of the active field in the form form.

function form_down_char(form::TUI_FORM)

Move to the down character of the active field in the form form.

function form_driver(form::Ptr{Cvoid}, ch::Integer)

Return type: Int32

For more information, consult libform documentation.

function form_end_field(form::TUI_FORM)

Move to the end of the active field in the form form.

function form_left_char(form::TUI_FORM)

Move to the left character of the active field in the form form.

function form_next_char(form::TUI_FORM)

Move to the next character of the active field in the form form.

function form_next_field(form::TUI_FORM)

Move to the next field of the form form.

function form_prev_char(form::TUI_FORM)

Move to the previous character of the active field in the form form.

function form_prev_field(form::TUI_FORM)

Move to the previous field of the form form.

function form_right_char(form::TUI_FORM)

Move to the right character of the active field in the form form.

function form_up_char(form::TUI_FORM)

Move to the up character of the active field in the form form.

function free_field(field::Ptr{Cvoid})

Return type: Int32

For more information, consult libform documentation.

function free_form(form::Ptr{Cvoid})

Return type: Int32

For more information, consult libform documentation.

function free_item(item::Ptr{Cvoid})

Return type: Int32

For more information, consult libmenu documentation.

function free_menu(menu::Ptr{Cvoid})

Return type: Int32

For more information, consult libmenu documentation.

function get_color_pair(foreground::Symbol, background::Symbol)

Return the ID of the color pair (foreground, background), or nothing if the color pair is not initialized.

function get_field_data(form::TUI_FORM, field_id::String, buffer::Int = 0)

Get the data of the field with ID field_id at buffer buffer in the form form

function get_field_data(field::TUI_FIELD, buffer::Int = 0)

Get the data of the field field at buffer buffer.

function get_focused_window()

Return the focused window.

function getbegx(win::Ptr{WINDOW})

Return type: Int32

For more information, consult libncurses documentation.

function getbegy(win::Ptr{WINDOW})

Return type: Int32

For more information, consult libncurses documentation.

function getch()

Return type: Int32

For more information, consult libncurses documentation.

function getcurx(win::Ptr{WINDOW})

Return type: Int32

For more information, consult libncurses documentation.

function getcury(win::Ptr{WINDOW})

Return type: Int32

For more information, consult libncurses documentation.

function getmaxx(win::Ptr{WINDOW})

Return type: Int32

For more information, consult libncurses documentation.

function getmaxy(win::Ptr{WINDOW})

Return type: Int32

For more information, consult libncurses documentation.

function has_colors()

Return type: UInt8

For more information, consult libncurses documentation.

function has_focus(window::Window, widget)

Return true if the widget widget is in focus on window window, or false otherwise.

function hide_panel(panel::Ptr{Cvoid})

Return type: Ptr{Nothing}

For more information, consult libmenu documentation.

function hide_window(win::Window)

Hide the window win.

function hline(ch::jlchtype, n::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function init_color(color::Integer, r::Integer, g::Integer, b::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function init_color(name::Symbol, r::Int, g::Int, b::Int)

Initialize the color with name name and RGB color r, g, and b. Notice that the range for the last three variables is [0,1000].

If the color is already initialized, then nothing will be changed.

If the color was initialized, then it returns the color ID. Otherwise, it returns -1.

function init_color_pair(foreground::Symbol, background::Symbol)

Initialize the color pair (foreground, background) and return its ID. If the pair already exists, then just the function just returns its ID.

function init_focus_manager()

Initialization of the focus manager. The elements in focus_chain are iterated to find the first one that can accept the focus.

function init_pair(pair::Integer, f::Integer, b::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function init_tui(dir::String = "")

Initialize the Text User Interface (TUI). The full-path of the ncurses directory can be specified by dir. If it is empty or omitted, then it will look on the default library directories.

function initscr()

Return type: Ptr{WINDOW}

For more information, consult libncurses documentation.

function item_description(menu::Ptr{Cvoid})

Return type: Cstring

For more information, consult libmenu documentation.

function item_index(menu::Ptr{Cvoid})

Return type: Int32

For more information, consult libmenu documentation.

function item_name(menu::Ptr{Cvoid})

Return type: Cstring

For more information, consult libmenu documentation.

function item_value(item::Ptr{Cvoid})

Return type: Int32

For more information, consult libmenu documentation.

function jlgetch(win::Union{Ptr{WINDOW},Nothing} = nothing)

Wait for an keystroke in the window win and return it (see Keystroke). If win is nothing, then getch() will be used instead of wgetch(win) to listen for the keystroke.

function keypad(win::Ptr{WINDOW}, bf::Bool)

Return type: Nothing

For more information, consult libncurses documentation.

function leaveok(win::Ptr{WINDOW}, bf::Bool)

Return type: Nothing

For more information, consult libncurses documentation.

function log_message(level::Int, msg::AbstractString, id::AbstractString = "")

Log the message msg with level level. The ID of the called can be specified by id.

function menu_down_item(menu::TUI_MENU)

Move down to an item of the menu menu.

function menu_down_line(menu::TUI_MENU)

Scroll down a line of the menu menu.

function menu_down_page(menu::TUI_MENU)

Scroll down a page of the menu menu.

function menu_driver(menu::Ptr{Cvoid}, c::Integer)

Return type: Int32

For more information, consult libmenu documentation.

function menu_first_item(menu::TUI_MENU)

Move to the first item of the menu menu.

function menu_last_item(menu::TUI_MENU)

Move to the last item of the menu menu.

function menu_left_item(menu::TUI_MENU)

Move left to an item of the menu menu.

function menu_next_item(menu::TUI_MENU)

Move to the next item of the menu menu.

function menu_prev_item(menu::TUI_MENU)

Move to the previous menu item of the menu.

function menu_right_item(menu::TUI_MENU)

Move right to an item of the menu menu.

function menu_toggle_item(menu::TUI_MENU)

Toggle the current item of the menu menu.

function menu_up_item(menu::TUI_MENU)

Move up to an item of the menu menu.

function menu_up_line(menu::TUI_MENU)

Scroll up a line of the menu menu.

function menu_up_page(menu::TUI_MENU)

Scroll up a page of the menu menu.

function mouseinterval(n::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function move_panel(panel::Ptr{Cvoid}, starty::Integer, startx::Integer)

Return type: Int32

For more information, consult libmenu documentation.

function move_view(win::Window, y::Integer, x::Integer; update::Bool = true)

Move the origin of the view of window win to the position (y,x). This routine makes sure that the view will never reach positions outside the buffer.

function move_view_inc(win::Window; Δy::Integer, Δx::Integer; kwargs...)

Move the view of the window win to the position (y+Δy, x+Δx). This function has the same set of keywords of the function move_view.

function move_window(win::Window, starty::Integer, startx::Integer)

Move the window win to the position (starty, startx).

function move_window_to_top(win::Window)

Move window win to the top.

function mvhline(y::Integer, x::Integer, ch::jlchtype, n::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function mvprintw(y::Integer, x::Integer, str::T) where T<:AbstractString

Return type: Nothing

For more information, consult libncurses documentation.

function mvvline(y::Integer, x::Integer, ch::jlchtype, n::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function mvwhline(win::Ptr{WINDOW}, y::Integer, x::Integer, ch::jlchtype, n::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function mvwprintw(win::Ptr{WINDOW}, y::Integer, x::Integer, str::T) where T<:AbstractString

Return type: Nothing

For more information, consult libncurses documentation.

function mvwvline(win::Ptr{WINDOW}, y::Integer, x::Integer, ch::jlchtype, n::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function ncurses_color([foreground::Symbol, background::Symbol,] attrs::Int = 0; kwargs...)

Return a mask to apply a color format with the foreground color foreground, background color background, and the attributes attrs.

If the pair (foreground, background) is omitted, then the foreground and background color will not be changed.

Keywords

  • bold: If true, then apply bold format mask to attrs. (Default = false)
  • underline: If true, then apply underline format mask to attrs. (Default = false)
function new_form(fields::Vector{Ptr{Cvoid}})

Return type: Ptr{Nothing}

For more information, consult libform documentation.

function new_item(name::T, description::T) where T<:AbstractString

Return type: Ptr{Nothing}

For more information, consult libmenu documentation.

function new_menu(items::Vector{Ptr{Cvoid}})

Return type: Ptr{Nothing}

For more information, consult libmenu documentation.

function new_panel(win::Ptr{WINDOW})

Return type: Ptr{Nothing}

For more information, consult libmenu documentation.

function newpad(lines::Integer, cols::Integer)

Return type: Ptr{WINDOW}

For more information, consult libncurses documentation.

function newwin(lines::Integer, cols::Integer, y::Integer, x::Integer)

Return type: Ptr{WINDOW}

For more information, consult libncurses documentation.

function next_widget(window::Window)

Move the focus of window window to the next widget.

function nodelay(win::Ptr{WINDOW}, bf::Bool)

Return type: Nothing

For more information, consult libncurses documentation.

function noecho()

Return type: Nothing

For more information, consult libncurses documentation.

function notimeout(win::Ptr{WINDOW}, bf::Bool)

Return type: Nothing

For more information, consult libncurses documentation.

function obj_desc(obj)

Return a string with the description of the object obj formed by:

<Object type> (<Object address if mutable>)
 function obj_to_ptr(obj)

Returns the hexadecimal representation of the address of the object obj. It only works with mutable objects. If obj is immutable, then 0x0 will be returned.

function panel_userptr(pan::Ptr{Cvoid})

Return type: Ptr{Nothing}

For more information, consult libmenu documentation.

function pnoutrefresh(win::Ptr{WINDOW}, pminrow::Integer, pmincol::Integer, sminrow::Integer, smincol::Integer, smaxrow::Integer, smaxcol::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function pos_form_cursor(form::Ptr{Cvoid})

Return type: Int32

For more information, consult libform documentation.

function pos_menu_cursor(menu::Ptr{Cvoid})

Return type: Int32

For more information, consult libmenu documentation.

function post_form(form::Ptr{Cvoid})

Return type: Int32

For more information, consult libform documentation.

function post_form(form::TUI_FORM)

Post the for form.

function post_menu(menu::Ptr{Cvoid})

Return type: Int32

For more information, consult libmenu documentation.

function post_menu(menu::TUI_MENU)

Post the menu menu.

function prefresh(win::Ptr{WINDOW}, pminrow::Integer, pmincol::Integer, sminrow::Integer, smincol::Integer, smaxrow::Integer, smaxcol::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function previous_widget(window::Window)

Move the focus of window window to the previous widget.

function printw(str::T) where T<:AbstractString

Return type: Nothing

For more information, consult libncurses documentation.

function process_focus(widget, k::Keystroke)

Process the actions when widget widget is in focus and the keystroke k is pressed. If it returns false, then it is means that the widget was not capable to process the focus. Otherwise, it must return true.

function process_focus(k::Keystroke)

Process the focus considering the user's keystorke k.

function process_focus(form::TUI_FORM, k::Keystroke)

Process the actions when the form form is in focus and the keystroke k was issued by the user.

function process_focus(menu::TUI_MENU, k::Keystroke)

Process the actions when the menu menu is in focus and the keystroke k was issued by the user.

function process_focus(window::Window, k::Keystroke)

Process the focus on window window due to keystroke k.

function redraw(widget)

Redraw the widget inside its content window cwin.

function refresh()

Return type: Nothing

For more information, consult libncurses documentation.

function refresh_all_windows()

Refresh all the windows, including the root window.

function refresh_window(id::String)

Refresh the window with id id and all its parents windows except for the root window.

function refresh_window(win::Window; update = true, backpropagation = true)

Refresh the window win and all its child windows. If the view needs to be updated (see view_needs_update), then the content of the buffer will be copied to the view before updating.

If update is true, then doupdate() is called and the physical screen is updated.

If backpropagation is true, then all the parents windows (except from the root window) will also be refreshed.

function release_focus(widget)

Request focus to be released. It should return true if the focus can be released or false otherwise.

function release_focus(form::TUI_FORM)

Release the focus from the form form.

function release_focus(menu::TUI_MENU)

Release the focus from the menu menu.

function request_update(widget)

Request update of the widget widget.

function resizeterm(lines::Integer, columns::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function selected_items(menu::TUI_MENU)

Return a Vector with the selected items in the menu menu.

function selected_items_desc(menu::TUI_MENU)

Return a Vector with the selected items descriptions in the menu menu.

function selected_items_names(menu::TUI_MENU)

Return a Vector with the selected items names in the menu menu.

function set_color([win::Window,] color::Int)

Set the color of the window win to color (see ncurses_color). If win is omitted, then it defaults to the root window.

function set_field_back(field::Ptr{Cvoid}, value::Integer)

Return type: Int32

For more information, consult libform documentation.

function set_field_buffer(field::Ptr{Cvoid}, buf::Int, c::T) where T<:AbstractString

Return type: Int32

For more information, consult libform documentation.

function set_field_just(field::Ptr{Cvoid}, justification::Integer)

Return type: Int32

For more information, consult libform documentation.

function set_field_opts(field::Ptr{Cvoid}, field_options::Integer)

Return type: Int32

For more information, consult libform documentation.

function set_field_type(field::Ptr{Cvoid}, type::Ptr{Cvoid}, valuelist::Vector, checkcase::Integer, checkunique::Integer)

Return type: Int32

For more information, consult libform documentation.

function set_field_type(field::Ptr{Cvoid}, type::Ptr{Cvoid}, padding::Integer, vmin::Float64, vmax::Float64)

Return type: Int32

For more information, consult libform documentation.

function set_field_type(field::Ptr{Cvoid}, type::Ptr{Cvoid}, padding::Integer, vmin::Integer, vmax::Integer)

Return type: Int32

For more information, consult libform documentation.

function set_field_type(field::Ptr{Cvoid}, type::Ptr{Cvoid}, arg::Integer)

Return type: Int32

For more information, consult libform documentation.

function set_field_type(field::Ptr{Cvoid}, type::Ptr{Cvoid}, regex::String)

Return type: Int32

For more information, consult libform documentation.

function set_focus_chain(wins::Window...; new_focus_id::Integer = 1)

Set the focus chain, i.e. the ordered list of windows that can receive the focus. The keyword new_focus_id can be set to specify which element is currently focused in the new chain.

function set_form_opts(form::Ptr{Cvoid}, form_options::Integer)

Return type: Int32

For more information, consult libform documentation.

function set_form_sub(form::Ptr{Cvoid}, win_form::Ptr{WINDOW})

Return type: Int32

For more information, consult libform documentation.

function set_form_win(form::Ptr{Cvoid}, win_form::Ptr{WINDOW})

Return type: Int32

For more information, consult libform documentation.

function set_form_win(form::TUI_FORM, win::Window)

Set the form form window to win.

function set_menu_format(menu::Ptr{Cvoid}, rows::Integer, cols::Integer)

Return type: Int32

For more information, consult libmenu documentation.

function set_menu_mark(menu::Ptr{Cvoid}, mark::T) where T<:AbstractString

Return type: Int32

For more information, consult libmenu documentation.

function set_menu_opts(menu::Ptr{Cvoid}, opts::Integer)

Return type: Int32

For more information, consult libmenu documentation.

function set_menu_sub(menu::Ptr{Cvoid}, win::Ptr{WINDOW})

Return type: Int32

For more information, consult libmenu documentation.

function set_menu_win(menu::Ptr{Cvoid}, win::Ptr{WINDOW})

Return type: Int32

For more information, consult libmenu documentation.

function set_menu_win(menu::TUI_MENU, win::Window)

Set menu menu window to win.

function set_next_window_func(f)

Set the function f to be the one that will be called to check whether the user wants the next window. The signature must be:

f(k::Keystroke)::Bool

It must return true if the next window is required of false otherwise.

function set_panel_userptr(pan::Ptr{Cvoid}, ptr::Ptr{Cvoid})

Return type: Int32

For more information, consult libmenu documentation.

function set_previous_window_func(f)

Set the function f to be the one that will be called to check whether the user wants the previous window. The signature must be:

f(k::Keystroke)::Bool

It must return true if the previous window is required of false otherwise.

function set_window_title(win::Window, title::AbstractString; ...)

Set the title of the window win to title.

Keywords

  • title_color: Color mask that will be used to print the title. See function ncurses_color. If negative, then the color will not be changed. (Default = -1)
function show_panel(panel::Ptr{Cvoid})

Return type: Ptr{Nothing}

For more information, consult libmenu documentation.

function show_window(win::Window)

Show the window win.

function start_color()

Return type: Int32

For more information, consult libncurses documentation.

function subpad(win::Ptr{WINDOW}, nlines::Integer, ncols::Integer, begin_y::Integer, begin_x::Integer)

Return type: Ptr{WINDOW}

For more information, consult libncurses documentation.

function sync_cursor(window::Window)

Synchronize the cursor to the position of the focused widget in window window. This is necessary because all the operations are done in the buffer and then copied to the view.

function top_panel(pan::Ptr{Cvoid})

Return type: Int32

For more information, consult libmenu documentation.

function touchwin(win::Ptr{WINDOW})

Return type: Nothing

For more information, consult libncurses documentation.

function unpost_form(form::Ptr{Cvoid})

Return type: Int32

For more information, consult libform documentation.

function unpost_form(form::TUI_FORM)

Unpost the form form.

function unpost_menu(menu::Ptr{Cvoid})

Return type: Int32

For more information, consult libmenu documentation.

function unpost_menu(menu::TUI_MENU)

Unpost the menu menu.

function unset_color([win::Window,] color::Number)

Unset the color color (see ncurses_color) in the window win. If win is omitted, then it defaults to the root window.

function update(widget; force_redraw = false)

Update the widget by calling the function redraw. This function returns true if the widget needed to be updated of false otherwise.

If force_redraw is true, then the widget will be updated even if it is not needed.

function update_panels()

Return type: Nothing

For more information, consult libmenu documentation.

function update_view(win::Window; force::Bool = false)

Update the view of window win by copying the contents from the buffer. If the view does not need to be updated (see view_needs_update), then nothing is done. If the keyword force is true, then the copy will always happen.

Return

It returns true if the view has been updated and false otherwise.

function vline(ch::jlchtype, n::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function waddch(win::Ptr{WINDOW}, ch::jlchtype)

Return type: Nothing

For more information, consult libncurses documentation.

function wattroff(win::Ptr{WINDOW}, attrs::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function wattron(win::Ptr{WINDOW}, attrs::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function wborder(win::Ptr{WINDOW}, ls::jlchtype, rs::jlchtype, ts::jlchtype, bs::jlchtype, tl::jlchtype, tr::jlchtype, bl::jlchtype, br::jlchtype)

Return type: Nothing

For more information, consult libncurses documentation.

function wborder(win::Ptr{WINDOW})

Call the function wborder(win, 0, 0, 0, 0, 0, 0, 0, 0).

function wclear(win::Ptr{WINDOW})

Return type: Nothing

For more information, consult libncurses documentation.

function wclrtobot(win::Ptr{WINDOW})

Return type: Int32

For more information, consult libncurses documentation.

function wclrtoeol(win::Ptr{WINDOW})

Return type: Int32

For more information, consult libncurses documentation.

function werase(win::Ptr{WINDOW})

Return type: Nothing

For more information, consult libncurses documentation.

function wgetch(win::Ptr{WINDOW})

Return type: Int32

For more information, consult libncurses documentation.

function whline(win::Ptr{WINDOW}, ch::jlchtype, n::Integer)

Return type: Int32

For more information, consult libncurses documentation.

function wmove(win::Ptr{WINDOW}, y::Integer, x::Integer)

Return type: Nothing

For more information, consult libncurses documentation.

function wnoutrefresh(win::Ptr{WINDOW})

Return type: Nothing

For more information, consult libncurses documentation.

function wprintw(win::Ptr{WINDOW}, str::T) where T<:AbstractString

Return type: Nothing

For more information, consult libncurses documentation.

function wrefresh(win::Ptr{WINDOW})

Return type: Nothing

For more information, consult libncurses documentation.

function wtimeout(win::Ptr{WINDOW}, delay::Integer)

Return type: Nothing

For more information, consult libncurses documentation.

function wvline(win::Ptr{WINDOW}, ch::jlchtype, n::Integer)

Return type: Int32

For more information, consult libncurses documentation.

macro log(level, msg, id)

Log the messagem msg with level level of the caller id

macro log(level, msg)

Log the message msg with level level.

struct NCURSES

This private structure handles some global variables that are used in the ncurses wrapper.

source
function _get_window_cur_pos(win::Ptr{WINDOW})

Get the cursor position of the window win and return it on a tuple (cur_y,cur_x). If the window is not initialized, then this function returns (-1,-1).

function _get_window_dims(win::Ptr{WINDOW})

Get the dimensions of the window win and return it on a tuple (dim_y,dim_x). If the window is not initialized, then this function returns (-1,-1).

function next_window()

Move the focus to the next window.

function previous_window()

Move the focus to the previous window.

function request_view_update(win::Window)

Request to update the view of window win. Notice that this must also request update on all parent windows until the root window.

function require_cursor()

If true, then the physical cursor will be shown and the position will be updated according to its position in the widget window. Otherwise, the physical cursor will be hidden.

macro _ccallf(expr)

Make a ccall to a libform function. The usage should be:

@_ccallf function(arg1::Type1, arg2::Type2, ...)::TypeReturn

It uses the global constant structure ncurses to call the function. Hence, it must be initialized.

macro _ccallm(expr)

Make a ccall to a libmenu function. The usage should be:

@_ccallf function(arg1::Type1, arg2::Type2, ...)::TypeReturn

It uses the global constant structure ncurses to call the function. Hence, it must be initialized.

macro _ccalln(expr)

Make a ccall to a libncurses function. The usage should be:

@_ccalln function(arg1::Type1, arg2::Type2, ...)::TypeReturn

It uses the global constant structure ncurses to call the function. Hence, it must be initialized.

macro _ccallm(expr)

Make a ccall to a libpanel function. The usage should be:

@_ccallf function(arg1::Type1, arg2::Type2, ...)::TypeReturn

It uses the global constant structure ncurses to call the function. Hence, it must be initialized.