在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):tboox/ltui开源软件地址(OpenSource Url):https://github.com/tboox/ltui开源编程语言(OpenSource Language):C 69.0%开源软件介绍(OpenSource Introduction):中文)Introduction (LTUI is a cross-platform terminal ui library based on Lua. This framework originated from the requirements of graphical menu configuration in xmake. 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 BuildWe need install the cross-platform build utility xmake first. $ xmake Run testsWe need install lua or luajit to run tests first. $ xmake run test dialog
$ xmake run test window
$ xmake run test desktop
$ xmake run test inputdialog
$ xmake run test 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 ExamplesApplicationlocal ltui = require("ltui")
local application = ltui.application
local event = ltui.event
local rect = ltui.rect
local window = ltui.window
local demo = application()
function demo: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))
end
demo:run() Labellocal lab = label:new("title", rect {0, 0, 12, 1}, "hello ltui!"):textattr_set("white") Buttonlocal btn = button:new("yes", rect {0, 1, 7, 2}, "< Yes >"):textattr_set("white") Input dialogfunction demo:init()
-- ...
local dialog_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
SnapshotMenu configurationInput dialogText areaWindowsTermuxIf you want to known more, please refer to: Contacts
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论