1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        LTUI基于 Lua 的跨平臺字符終端 UI 界面庫

        聯(lián)合創(chuàng)作 · 2023-09-28 06:28

        簡介

        LTUI是一個基于lua的跨平臺字符終端UI界面庫。

        此框架源于xmake中圖形化菜單配置的需求,類似linux kernel的menuconf去配置編譯參數(shù),因此基于curses和lua實現(xiàn)了一整套跨平臺的字符終端ui庫。 而樣式風(fēng)格基本上完全參照的kconfig-frontends,當(dāng)然用戶也可以自己定制不同的ui風(fēng)格。

        安裝

        $ luarocks install ltui

        編譯

        我們需要先安裝跨平臺構(gòu)建工具:xmake

        $ xmake

        運行測試

        你需要先安裝lua或者luajit程序去加載運行測試程序:

        $ xmake run test dialog
        $ xmake run test window
        $ xmake run test desktop
        $ xmake run test inputdialog
        $ xmake run test mconfdialog

        或者

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

        或者

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

        例子

        應(yīng)用程序

        local 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()

        標(biāo)簽

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

        按鈕

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

        輸入框

        function 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

        組件

        視圖 對話框 其他
        view dialog event
        panel boxdialog action
        label textdialog canvas
        button inputdialog curses
        border mconfdialog program
        window choicedialog application
        menubar   point
        menuconf   rect
        textedit   object
        textarea    
        statusbar    
        choicebox    
        desktop    

        快照

        菜單配置

        輸入框

        文本區(qū)域

        如果你想了解更多,請參考:

        瀏覽 9
        點贊
        評論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報
        評論
        圖片
        表情
        推薦
        點贊
        評論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            欧美肉体交换艳史 | 精品99视频 | 性色情爱一二三区A级高清视 | 91老熟女| 香蕉久久久久成人麻豆AV影院 | 久久久久无码精品国产H动漫猫咪 | 欧美日韩国产免费一区二区三区 | 欧美第一区第二区韩国视频在线观看 | 久久精品国产免费久久 | 无码视频中文字幕 |