Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/ltuiPublic

🍖 A cross-platform terminal ui library based on Lua

License

NotificationsYou must be signed in to change notification settings

tboox/ltui

Repository files navigation

github-ciGithub All ReleasesLuarocks
licenseRedditGitterTelegramQQDonate

A cross-platform terminal ui library based on Lua

Introduction (中文)

LTUI is a cross-platform terminal ui library based on Lua.

This framework originated from the requirements of graphical menu configuration inxmake.Similar to the linux kernel's menuconf to configure the compilation parameters, so using curses and lua to implement a cross-platform character terminal ui library.

Refer to kconfig-frontends for style rendering. Of course, users can customize different ui styles.

Installation

$luarocks install ltui

Build

We need install the cross-platform build utilityxmake first.

$xmake

Run tests

We need installlua orluajit to run tests first.

$xmake runtest dialog$xmake runtest window$xmake runtest desktop$xmake runtest inputdialog$xmake runtest mconfdialog

Or

$lua tests/dialog.lua$lua tests/window.lua$lua tests/desktop.lua$lua tests/inputdialog.lua$lua tests/mconfdialog.lua

Or

$luajit tests/dialog.lua$luajit tests/window.lua$luajit tests/desktop.lua$luajit tests/inputdialog.lua$luajit tests/mconfdialog.lua

Examples

Application

localltui=require("ltui")localapplication=ltui.applicationlocalevent=ltui.eventlocalrect=ltui.rectlocalwindow=ltui.windowlocaldemo=application()functiondemo:init()application.init(self,"demo")self:background_set("blue")self:insert(window:new("window.main",rect {1,1,self:width()-1,self:height()-1},"main window",true))enddemo:run()

Label

locallab=label:new("title",rect {0,0,12,1},"hello ltui!"):textattr_set("white")

Button

localbtn=button:new("yes",rect {0,1,7,2},"< Yes >"):textattr_set("white")

Input dialog

functiondemo:init()-- ...localdialog_input=inputdialog:new("dialog.input",rect {0,0,50,8})dialog_input:text():text_set("please input text:")dialog_input:button_add("no","< No >",function (v)dialog_input:quit()end)dialog_input:button_add("yes","< Yes >",function (v)dialog_input:quit()end)self:insert(dialog_input, {centerx=true,centery=true})end

Components

viewsdialogsothers
viewdialogevent
panelboxdialogaction
labeltextdialogcanvas
buttoninputdialogcurses
bordermconfdialogprogram
windowchoicedialogapplication
menubarpoint
menuconfrect
texteditobject
textarea
statusbar
choicebox
desktop

Snapshot

Menu configuration

Input dialog

Text area

Windows

Termux

If you want to known more, please refer to:

Contacts


[8]ページ先頭

©2009-2025 Movatter.jp