# Text-UI View backend

DevFeed: [Text-UI View backend](<https://devfeed.tech/articles/text-ui-view-backend-22389.md>)

Original publisher: [Read original article](<https://www.red-lang.org/2024/06/text-ui-view-backend.html>)

Author: Nenad Rakocevic (noreply@blogger.com)

Published: 2024-06-11T14:02:00Z

Content type: release

Language: en

Sources: [Red](<https://devfeed.tech/sources/red.md>)

Topics: [Text-based user interface](<https://devfeed.tech/topics/tui.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>), [Red](<https://devfeed.tech/topics/red.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [macOS](<https://devfeed.tech/topics/macos.md>)

Tags: [cli](<https://devfeed.tech/tags/cli.md>), [console](<https://devfeed.tech/tags/console.md>), [examples](<https://devfeed.tech/tags/examples.md>), [features](<https://devfeed.tech/tags/features.md>), [linux](<https://devfeed.tech/tags/linux.md>), [macos](<https://devfeed.tech/tags/macos.md>), [ui](<https://devfeed.tech/tags/ui.md>), [user-interfaces](<https://devfeed.tech/tags/user-interfaces.md>)

## AI overview

Red/View now includes a usable, though incomplete, text-based user interface backend. The article outlines its supported widgets, drawing commands, keyboard and optional mouse handling, colors, timers, facets, platforms, configuration, and usage examples.

## Source excerpt

Last year, qtxie worked on a toy text backend project and submitted a PR for that. After some extra additions and testing recently, it has now been merged even if it is still incomplete, it is usable enough. So, in addition to the shiny GUI backends in Red/View, now we have an old-school text-based user interfaces (TUI) backend for the View engine! The new TUI backend has currently a subset of the GUI backends features. Here is an overview: View styles: base, panel, button, check, radio, field, text, progress, rich-text, image and text-list. Draw commands: text, line, box, triangle, circle, ellipse (block-based for now). Rich-text supported in Draw. Keyboard handling: key-down and key events (which are the same event). Mouse handling: disabled by default. Use system/view/platform/mouse-event?: yes to enable it. Images support Truecolor (24-bit RGB) for image rendering if the terminal supports it, otherwise it falls back to 256 colors. Timers supported through /rate facet. Facets supported: /offset, /size, /text, /image, /color, /data, /enabled?, /visible?, /selected, /flags, /options, /pane, /rate, /para and /draw. Flags supported: password and all-over. Frames drawing using squared or rounded corners ( Limited ANSI escape codes support in /text facet, only Colors / Graphics Mode codes. Uses 256 colors for text. It should works fine on most of the terminals. Works on the big-3 platforms (Linux, macOS and Windows10/11). The pre-built CLI console binaries on our Download page now have View/VID included by default along with the TUI backend. You can use them to test and play with the TUI code examples here and in the TUI folder. To use the TUI backend in your own compiled code, you need to add the two following options in the Red header block: Needs: 'View Config: [GUI-engine: 'terminal] Here are a few examples, starting with a HelloWorld!: view [text "Hello TUI World!"] Hello TUI World! When view is invoked, an event loop is launched. In order to return back to the co